Skip to content
Draft
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 @@ -125,6 +125,7 @@ class ChinookAIUpdate : public SupplyTruckAIUpdate

void private___TellPortableStructureToAttackWithMe( Object *victim, Int maxShotsToFire, CommandSourceType cmdSource );

ObjectID getAirfieldForHealing() const { return m_airfieldForHealing; }

private:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ class JetAIUpdate : public AIUpdateInterface
void positionLockon();

virtual Bool getTreatAsAircraftForLocoDistToGoal() const override;
Bool isParkedAt(const Object* obj) const;

private:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,11 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms)
#else
// TheSuperHackers @bugfix Stubbjax 31/10/2025 Don't leave healing state for evacuation commands.
if (parms->m_cmd != AICMD_EVACUATE && parms->m_cmd != AICMD_EXIT)
setAirfieldForHealing(INVALID_ID);
{
// TheSuperHackers @bugfix Caball009 12/08/2026 Don't leave healing state if chinook is already repairing at this airfield.
if (!(parms->m_cmd == AICMD_GET_REPAIRED && parms->m_obj->getID() == getAirfieldForHealing()))
setAirfieldForHealing(INVALID_ID);
}
#endif

if (!isAllowedToRespondToAiCommands(parms))
Expand Down Expand Up @@ -1370,6 +1374,20 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms)
}
break;

#if !RETAIL_COMPATIBLE_CRC
case AICMD_GET_REPAIRED:
{
// TheSuperHackers @bugfix Caball009 12/08/2026 Don't process command if chinook is already repairing at this airfield.
if (parms->m_obj->getID() == getAirfieldForHealing())
{
passItThru = false;
break;
}

FALLTHROUGH;
}
#endif

default:
{
if (m_flightStatus != CHINOOK_FLYING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2527,24 +2527,6 @@

}

//-------------------------------------------------------------------------------------------------
Bool JetAIUpdate::isParkedAt(const Object* obj) const
{
if (!getFlag(ALLOW_AIR_LOCO) &&
!getObject()->isKindOf(KINDOF_PRODUCED_AT_HELIPAD) &&
obj != nullptr)
{
Object* airfield;
ParkingPlaceBehaviorInterface* pp = getPP(getObject()->getProducerID(), &airfield);
if (pp != nullptr && airfield != nullptr && airfield == obj)
{
return true;
}
}

return false;
}

//-------------------------------------------------------------------------------------------------
void JetAIUpdate::aiDoCommand(const AICommandParms* parms)
{
Expand Down Expand Up @@ -2609,19 +2591,29 @@
return;
}

FALLTHROUGH;
goto defaultCase; // cannot fall through to get to the default case!
#endif

case AICMD_ENTER:
case AICMD_GET_REPAIRED:
// if we're already located at the airfield in question, just ignore.
// TheSuperHackers @bugfix Caball009 12/08/2026 This applies to units produced at the helipad now as well.
#if RETAIL_COMPATIBLE_CRC
if (parms->m_obj && !getObject()->isKindOf(KINDOF_PRODUCED_AT_HELIPAD))
#else
if (parms->m_obj)
#endif
{
Object* airfield = nullptr;
ParkingPlaceBehaviorInterface* pp = getPP(getObject()->getProducerID(), &airfield);
if (pp != nullptr && airfield == parms->m_obj)
return;
}

// if we're already parked at the airfield in question, just ignore.
if (isParkedAt(parms->m_obj))
return;

FALLTHROUGH; // else fall thru to the default case!
FALLTHROUGH; // else fall through to the default case!

default:
defaultCase:
{
// nuke any existing pending cmd
m_mostRecentCommand.store(*parms);
Expand All @@ -2644,7 +2636,7 @@
case AICMD_HUNT:
case AICMD_GUARD_RETALIATE:
setFlag(ALLOW_INTERRUPT_AND_RESUME_OF_CUR_STATE_FOR_RELOAD, true);
break;

Check warning on line 2639 in GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'defaultCase' : unreferenced label

Check warning on line 2639 in GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6+t+e

'defaultCase' : unreferenced label

Check warning on line 2639 in GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-profile+t+e

'defaultCase' : unreferenced label

Check warning on line 2639 in GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-releaselog+t+e

'defaultCase' : unreferenced label
default:
setFlag(ALLOW_INTERRUPT_AND_RESUME_OF_CUR_STATE_FOR_RELOAD, false);
break;
Expand Down
Loading