Skip to content

Conversation

@Stubbjax
Copy link

Fixes #1224 from the patch repository

This change fixes an issue where the GLA Battle Bus is unable to respond to attack commands issued on an object while in bunkered form.

Demonstration

With the fix applied, the Battle Bus can now attack the specified target

BUS_ATTACK.mp4

@Stubbjax Stubbjax self-assigned this Jan 29, 2026
@Stubbjax Stubbjax added Bug Something is not working right, typically is user facing GLA Affects GLA faction Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour NoRetail This fix or change is not applicable with Retail game compatibility labels Jan 29, 2026
@greptile-apps
Copy link

greptile-apps bot commented Jan 29, 2026

Greptile Overview

Greptile Summary

This PR fixes a bug where the GLA Battle Bus cannot respond to attack commands while in bunkered form by conditionally disabling the DISABLED_HELD check in AIGroup::groupAttackObjectPrivate(). The fix wraps the problematic logic in #if RETAIL_COMPATIBLE_CRC to maintain backward compatibility.

Changes:

  • Wrapped the DISABLED_HELD check in both Generals and GeneralsMD versions of AIGroup.cpp with RETAIL_COMPATIBLE_CRC preprocessor guard
  • Added explanatory comment identifying the bug and referencing the fix author
  • When RETAIL_COMPATIBLE_CRC=0, the code allows bunkered Battle Buses to be included in the attack iterator, enabling their occupants to respond to attack commands

Context:
This is a cleaner solution that addresses the root cause by modifying the AI group attack logic, replacing previous workarounds that modified Battle Bus behavior, building restrictions, and UI command availability.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are minimal, well-scoped, and protected by a compatibility flag. The fix addresses the root cause elegantly by conditionally disabling problematic logic rather than adding workarounds elsewhere. The identical changes in both Generals and GeneralsMD ensure consistency.
  • No files require special attention

Important Files Changed

Filename Overview
Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp Wraps DISABLED_HELD check in RETAIL_COMPATIBLE_CRC to fix Battle Bus attack commands
GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp Wraps DISABLED_HELD check in RETAIL_COMPATIBLE_CRC to fix Battle Bus attack commands

Sequence Diagram

sequenceDiagram
    participant Player
    participant AIGroup
    participant BattleBus
    participant Occupants
    
    Player->>AIGroup: Issue attack command on target
    AIGroup->>AIGroup: groupAttackObjectPrivate()
    AIGroup->>AIGroup: Iterate through member list
    
    alt RETAIL_COMPATIBLE_CRC=1 (Old behavior)
        AIGroup->>BattleBus: Check isDisabledByType(DISABLED_HELD)
        BattleBus-->>AIGroup: Returns true (bunkered)
        AIGroup->>AIGroup: continue (skip unit)
        Note over AIGroup,Occupants: Bug: Occupants never receive attack command
    else RETAIL_COMPATIBLE_CRC=0 (Fixed behavior)
        AIGroup->>AIGroup: Skip DISABLED_HELD check
        AIGroup->>BattleBus: Add to attack iterator
        AIGroup->>BattleBus: Check isPassengerAllowedToFire()
        BattleBus-->>AIGroup: Returns true
        AIGroup->>Occupants: Issue attack command to occupants
        Occupants->>Player: Respond to attack command
    end
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Gen Relates to Generals GLA Affects GLA faction Minor Severity: Minor < Major < Critical < Blocker NoRetail This fix or change is not applicable with Retail game compatibility ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bunkered Busses can't target buildings

1 participant