bugfix(contain): Allow passengers to exit immobilized Battle Buses - #3041
bugfix(contain): Allow passengers to exit immobilized Battle Buses#3041bobtista wants to merge 2 commits 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?
There was a problem hiding this comment.
It was LLM generated, and your approach works - updated accordingly
There was a problem hiding this comment.
This is part of the problem with taking over another's work without communicating it - you miss the context.
I originally checked for the DISABLED_HELD status as it seemed more comprehensive than simply checking if it was contained, but I missed the fact that Battle Buses become DISABLED_HELD when initially destroyed. I also possibly had my local fix to streamline this behaviour to apply IMMOBILE at the time.
The actual follow-up solution that I had intended was to simply replace this condition with a containment check.
- if (specificObject->getContainedBy()->isDisabledByType(DISABLED_HELD))
+ if (specificObject->getContainedBy()->isContained())Can you please verify this is all that is required?
… 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, 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