From efcf500a13314c3021ab8ccb4b9542999099ee94 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Tue, 4 Nov 2025 15:09:14 +1100 Subject: [PATCH 1/3] bugfix: Chinooks and Helixes now correctly wait for their passengers to disembark --- .../GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp | 4 ++++ .../GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index 7c13cab791c..7384dba604e 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -1166,7 +1166,11 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms) setMyState(TAKING_OFF, NULL, NULL, CMD_FROM_AI); passItThru = false; } +#if RETAIL_COMPATIBLE_CRC else +#else + else if (getObject()->getContain() && getObject()->getContain()->hasObjectsWantingToEnterOrExit()) +#endif { // do this INSTEAD of the standard stuff setMyState( diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index c6fca758211..b1da0d9f89e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -1301,7 +1301,11 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms) setMyState(TAKING_OFF, NULL, NULL, CMD_FROM_AI); passItThru = false; } +#if RETAIL_COMPATIBLE_CRC else +#else + else if (getObject()->getContain() && getObject()->getContain()->hasObjectsWantingToEnterOrExit()) +#endif { // do this INSTEAD of the standard stuff setMyState( From 2869b7f3decb52e188efdb46c2f14da6663aded8 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Fri, 23 Jan 2026 03:04:39 +1100 Subject: [PATCH 2/3] docs: Add comments --- .../Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp | 1 + .../Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index 7384dba604e..931c62682b2 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -1169,6 +1169,7 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms) #if RETAIL_COMPATIBLE_CRC else #else + // TheSuperHackers @bugfix Stubbjax 04/11/2025 Passengers are no longer all dumped in a single frame. else if (getObject()->getContain() && getObject()->getContain()->hasObjectsWantingToEnterOrExit()) #endif { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index b1da0d9f89e..f0255c7df03 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -1304,6 +1304,7 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms) #if RETAIL_COMPATIBLE_CRC else #else + // TheSuperHackers @bugfix Stubbjax 04/11/2025 Passengers are no longer all dumped in a single frame. else if (getObject()->getContain() && getObject()->getContain()->hasObjectsWantingToEnterOrExit()) #endif { From 360c3727ac28dd52211e1af17eb5c3a00b368014 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Fri, 23 Jan 2026 03:29:53 +1100 Subject: [PATCH 3/3] refactor: Streamline logic --- .../Object/Update/AIUpdate/ChinookAIUpdate.cpp | 15 +++++++++------ .../Object/Update/AIUpdate/ChinookAIUpdate.cpp | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index 931c62682b2..0e8d68f28ca 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -1156,6 +1156,14 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms) { const Real THRESH = 3.0f; const Real THRESH_SQR = THRESH*THRESH; +#if RETAIL_COMPATIBLE_CRC + const bool allowExit = true; +#else + // TheSuperHackers @bugfix Stubbjax 04/11/2025 Passengers are no longer all dumped in a single frame. + const ContainModuleInterface* contain = getObject()->getContain(); + const bool allowExit = contain && contain->hasObjectsWantingToEnterOrExit(); +#endif + if (calcDistSqr(*getObject()->getPosition(), parms->m_pos) > THRESH_SQR && m_flightStatus == CHINOOK_LANDED) { @@ -1166,12 +1174,7 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms) setMyState(TAKING_OFF, NULL, NULL, CMD_FROM_AI); passItThru = false; } -#if RETAIL_COMPATIBLE_CRC - else -#else - // TheSuperHackers @bugfix Stubbjax 04/11/2025 Passengers are no longer all dumped in a single frame. - else if (getObject()->getContain() && getObject()->getContain()->hasObjectsWantingToEnterOrExit()) -#endif + else if (allowExit) { // do this INSTEAD of the standard stuff setMyState( diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp index f0255c7df03..c355d03d41f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -1291,6 +1291,14 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms) { const Real THRESH = 3.0f; const Real THRESH_SQR = THRESH*THRESH; +#if RETAIL_COMPATIBLE_CRC + const bool allowExit = true; +#else + // TheSuperHackers @bugfix Stubbjax 04/11/2025 Passengers are no longer all dumped in a single frame. + const ContainModuleInterface* contain = getObject()->getContain(); + const bool allowExit = contain && contain->hasObjectsWantingToEnterOrExit(); +#endif + if (calcDistSqr(*getObject()->getPosition(), parms->m_pos) > THRESH_SQR && m_flightStatus == CHINOOK_LANDED) { @@ -1301,12 +1309,7 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms) setMyState(TAKING_OFF, NULL, NULL, CMD_FROM_AI); passItThru = false; } -#if RETAIL_COMPATIBLE_CRC - else -#else - // TheSuperHackers @bugfix Stubbjax 04/11/2025 Passengers are no longer all dumped in a single frame. - else if (getObject()->getContain() && getObject()->getContain()->hasObjectsWantingToEnterOrExit()) -#endif + else if (allowExit) { // do this INSTEAD of the standard stuff setMyState(