Skip to content

bugfix(contain): Allow passengers to exit immobilized Battle Buses - #3041

Open
bobtista wants to merge 1 commit into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/transport-contain-held-exit
Open

bugfix(contain): Allow passengers to exit immobilized Battle Buses#3041
bobtista wants to merge 1 commit into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/transport-contain-held-exit

Conversation

@bobtista

@bobtista bobtista commented Aug 1, 2026

Copy link
Copy Markdown

In non-retail-compatible builds, TransportContain::isSpecificRiderFreeToExit rejects a passenger whenever its container has DISABLED_HELD. An immobilized Battle Bus uses that status for its second-life hulk, so neither evacuate-all nor individual passenger exit requests can remove its occupants.

Now exits are blocked only when the transport is itself contained by another object and held, preserving the nested-container guard while allowing an immobilized Battle Bus to unload its passengers and begin its empty-hulk destruction delay.

Todo:

  • Verify evacuate-all and individual passenger exits from an immobilized Battle Bus with RETAIL_COMPATIBLE_CRC=0
  • Replicate to Generals - N/A, Battle Bus is Zero Hour only

@bobtista bobtista self-assigned this Aug 1, 2026
@bobtista bobtista added Bug Something is not working right, typically is user facing NoRetail This fix or change is not applicable with Retail game compatibility labels Aug 1, 2026
@greptile-apps

greptile-apps Bot commented Aug 1, 2026

Copy link
Copy Markdown

Greptile Summary

The PR narrows the held-container exit restriction so immobilized Battle Buses can unload while preserving the guard for transports nested inside another object.

  • Replaces the rider-container assertion and broad DISABLED_HELD rejection with a nested-transport condition.
  • Applies only to non-retail-compatible Zero Hour builds.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp Narrows the passenger-exit restriction to held transports that are themselves contained, enabling immobilized Battle Buses to unload as intended.

Reviews (2): Last reviewed commit: "bugfix(contain): Allow passengers to exi..." | Re-trigger Greptile

Comment thread GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp Outdated
@xezon xezon added the ThisProject The issue was introduced by this project, or this task is specific to this project label Aug 1, 2026
@bobtista
bobtista force-pushed the bobtista/bugfix/transport-contain-held-exit branch from d5a0c59 to 0080a03 Compare August 1, 2026 16:34
// TheSuperHackers @bugfix Stubbjax/bobtista 01/08/2026 We are not free to exit when our container
// is held inside another container. A container merely held in place on the terrain,
// eg the battle bus, can still unload passengers.
if (me->getContainedBy() != nullptr && me->isDisabledByType(DISABLED_HELD))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the me->isDisabledByType(DISABLED_HELD) condition still needed then? In what situation would me->getContainedBy() != nullptr be true and me->isDisabledByType(DISABLED_HELD) be false?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are equivalent for the normal stock transport-containment paths, but they are distinct engine states: OpenContain/HealContain can contain objects without setting DISABLED_HELD, and scripts can change the flag independently. Keeping both limits this fix to transports that are actually nested and held; the added getContainedBy() check is what distinguishes those from a Battle Bus merely held in place on the terrain.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an LLM generated answer or actually verified to be correct?

ChromaticAbyss pushed a commit to ChromaticAbyss/GeneralsGameCode that referenced this pull request Aug 1, 2026
ChromaticAbyss pushed a commit to ChromaticAbyss/GeneralsGameCode that referenced this pull request Aug 2, 2026
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 NoRetail This fix or change is not applicable with Retail game compatibility ThisProject The issue was introduced by this project, or this task is specific to this project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Battle bus cannot evac when it's in its immobilized hunk mode when retail compat is off

2 participants