bugfix(contain): Allow passengers to exit immobilized Battle Buses - #3041
bugfix(contain): Allow passengers to exit immobilized Battle Buses#3041bobtista wants to merge 1 commit into
Conversation
|
| 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
d5a0c59 to
0080a03
Compare
| // 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)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Is this an LLM generated answer or actually verified to be correct?
… the next upstream rebase
… the next upstream rebase
In non-retail-compatible builds,
TransportContain::isSpecificRiderFreeToExitrejects a passenger whenever its container hasDISABLED_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:
RETAIL_COMPATIBLE_CRC=0