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..c24c9b6a959 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -1002,9 +1002,16 @@ Bool ChinookAIUpdate::chooseLocomotorSet(LocomotorSetType wst) UpdateSleepTime ChinookAIUpdate::update() { ParkingPlaceBehaviorInterface* pp = getPP(m_airfieldForHealing); + const ContainModuleInterface* contain = getObject()->getContain(); + const Bool waitingToEnterOrExit = contain && contain->hasObjectsWantingToEnterOrExit(); + if (pp != NULL) { if (m_flightStatus == CHINOOK_LANDED && +#if !RETAIL_COMPATIBLE_CRC + // TheSuperHackers @bugfix Stubbjax 03/11/2025 Prevent Chinooks from taking off while there are still units wanting to enter or exit. + !waitingToEnterOrExit && +#endif !m_hasPendingCommand && getObject()->getBodyModule()->getHealth() == getObject()->getBodyModule()->getMaxHealth()) { @@ -1026,10 +1033,8 @@ UpdateSleepTime ChinookAIUpdate::update() // when we have a pending command... if (SupplyTruckAIUpdate::isIdle()) { - ContainModuleInterface* contain = getObject()->getContain(); if( contain ) { - Bool waitingToEnterOrExit = contain->hasObjectsWantingToEnterOrExit(); if (m_hasPendingCommand) { AICommandParms parms(AICMD_MOVE_TO_POSITION, CMD_FROM_AI); // values don't matter, will be wiped by next line 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..eaeeffee975 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp @@ -1064,9 +1064,16 @@ Bool ChinookAIUpdate::chooseLocomotorSet(LocomotorSetType wst) UpdateSleepTime ChinookAIUpdate::update() { ParkingPlaceBehaviorInterface* pp = getPP(m_airfieldForHealing); + const ContainModuleInterface* contain = getObject()->getContain(); + const Bool waitingToEnterOrExit = contain && contain->hasObjectsWantingToEnterOrExit(); + if (pp != NULL) { if (m_flightStatus == CHINOOK_LANDED && +#if !RETAIL_COMPATIBLE_CRC + // TheSuperHackers @bugfix Stubbjax 03/11/2025 Prevent Chinooks from taking off while there are still units wanting to enter or exit. + !waitingToEnterOrExit && +#endif !m_hasPendingCommand && getObject()->getBodyModule()->getHealth() == getObject()->getBodyModule()->getMaxHealth()) { @@ -1088,12 +1095,10 @@ UpdateSleepTime ChinookAIUpdate::update() // have to call our parent's isIdle, because we override it to never return true // when we have a pending command... - ContainModuleInterface* contain = getObject()->getContain(); if( contain ) { if (SupplyTruckAIUpdate::isIdle()) { - Bool waitingToEnterOrExit = contain->hasObjectsWantingToEnterOrExit(); if (m_hasPendingCommand) { AICommandParms parms(AICMD_MOVE_TO_POSITION, CMD_FROM_AI); // values don't matter, will be wiped by next line