Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Comment thread
xezon marked this conversation as resolved.
#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())
{
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand All @@ -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
Expand Down
Loading