Skip to content

Commit 646e3dd

Browse files
authored
bugfix(aiupdate): Chinooks and Helixes no longer take off after repair if passengers want to board or exit (#1787)
1 parent 03b9ae8 commit 646e3dd

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,9 +1002,16 @@ Bool ChinookAIUpdate::chooseLocomotorSet(LocomotorSetType wst)
10021002
UpdateSleepTime ChinookAIUpdate::update()
10031003
{
10041004
ParkingPlaceBehaviorInterface* pp = getPP(m_airfieldForHealing);
1005+
const ContainModuleInterface* contain = getObject()->getContain();
1006+
const Bool waitingToEnterOrExit = contain && contain->hasObjectsWantingToEnterOrExit();
1007+
10051008
if (pp != NULL)
10061009
{
10071010
if (m_flightStatus == CHINOOK_LANDED &&
1011+
#if !RETAIL_COMPATIBLE_CRC
1012+
// TheSuperHackers @bugfix Stubbjax 03/11/2025 Prevent Chinooks from taking off while there are still units wanting to enter or exit.
1013+
!waitingToEnterOrExit &&
1014+
#endif
10081015
!m_hasPendingCommand &&
10091016
getObject()->getBodyModule()->getHealth() == getObject()->getBodyModule()->getMaxHealth())
10101017
{
@@ -1026,10 +1033,8 @@ UpdateSleepTime ChinookAIUpdate::update()
10261033
// when we have a pending command...
10271034
if (SupplyTruckAIUpdate::isIdle())
10281035
{
1029-
ContainModuleInterface* contain = getObject()->getContain();
10301036
if( contain )
10311037
{
1032-
Bool waitingToEnterOrExit = contain->hasObjectsWantingToEnterOrExit();
10331038
if (m_hasPendingCommand)
10341039
{
10351040
AICommandParms parms(AICMD_MOVE_TO_POSITION, CMD_FROM_AI); // values don't matter, will be wiped by next line

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,9 +1064,16 @@ Bool ChinookAIUpdate::chooseLocomotorSet(LocomotorSetType wst)
10641064
UpdateSleepTime ChinookAIUpdate::update()
10651065
{
10661066
ParkingPlaceBehaviorInterface* pp = getPP(m_airfieldForHealing);
1067+
const ContainModuleInterface* contain = getObject()->getContain();
1068+
const Bool waitingToEnterOrExit = contain && contain->hasObjectsWantingToEnterOrExit();
1069+
10671070
if (pp != NULL)
10681071
{
10691072
if (m_flightStatus == CHINOOK_LANDED &&
1073+
#if !RETAIL_COMPATIBLE_CRC
1074+
// TheSuperHackers @bugfix Stubbjax 03/11/2025 Prevent Chinooks from taking off while there are still units wanting to enter or exit.
1075+
!waitingToEnterOrExit &&
1076+
#endif
10701077
!m_hasPendingCommand &&
10711078
getObject()->getBodyModule()->getHealth() == getObject()->getBodyModule()->getMaxHealth())
10721079
{
@@ -1088,12 +1095,10 @@ UpdateSleepTime ChinookAIUpdate::update()
10881095

10891096
// have to call our parent's isIdle, because we override it to never return true
10901097
// when we have a pending command...
1091-
ContainModuleInterface* contain = getObject()->getContain();
10921098
if( contain )
10931099
{
10941100
if (SupplyTruckAIUpdate::isIdle())
10951101
{
1096-
Bool waitingToEnterOrExit = contain->hasObjectsWantingToEnterOrExit();
10971102
if (m_hasPendingCommand)
10981103
{
10991104
AICommandParms parms(AICMD_MOVE_TO_POSITION, CMD_FROM_AI); // values don't matter, will be wiped by next line

0 commit comments

Comments
 (0)