Skip to content

Commit e87b99b

Browse files
committed
bugfix: Make healed helicopters follow airfield rally point
Signed-off-by: tintinhamans <5984296+tintinhamans@users.noreply.github.com>
1 parent 39d8406 commit e87b99b

4 files changed

Lines changed: 65 additions & 1 deletion

File tree

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,22 @@ UpdateSleepTime ChinookAIUpdate::update()
10311031
{
10321032
// we're completely healed, so take off again
10331033
pp->setHealee(getObject(), false);
1034+
1035+
// TheSuperHackers @bugfix arcticdolphin 08/02/2026 Move healed Chinook to rally point if present.
1036+
#if !RETAIL_COMPATIBLE_CRC
1037+
{
1038+
Object *airfield = TheGameLogic->findObjectByID( m_airfieldForHealing );
1039+
const Coord3D *rp = airfield->getObjectExitInterface()->getRallyPoint();
1040+
if( rp )
1041+
{
1042+
AICommandParms parms( AICMD_MOVE_TO_POSITION, CMD_FROM_AI );
1043+
parms.m_pos = *rp;
1044+
m_pendingCommand.store( parms );
1045+
m_hasPendingCommand = true;
1046+
}
1047+
}
1048+
#endif
1049+
10341050
setMyState(TAKING_OFF, nullptr, nullptr, CMD_FROM_AI);
10351051
}
10361052
else

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,22 @@ UpdateSleepTime JetAIUpdate::update()
17751775
friend_setAllowAirLoco(true);
17761776
getStateMachine()->clear();
17771777
setLastCommandSource( CMD_FROM_AI );
1778+
1779+
// TheSuperHackers @bugfix arcticdolphin 08/02/2026 Move healed helicopter to rally point if present.
1780+
#if !RETAIL_COMPATIBLE_CRC
1781+
{
1782+
Object *airfield = TheGameLogic->findObjectByID( jet->getProducerID() );
1783+
const Coord3D *rp = airfield->getObjectExitInterface()->getRallyPoint();
1784+
if( rp )
1785+
{
1786+
AICommandParms parms( AICMD_MOVE_TO_POSITION, CMD_FROM_AI );
1787+
parms.m_pos = *rp;
1788+
m_mostRecentCommand.store( parms );
1789+
setFlag(HAS_PENDING_COMMAND, true);
1790+
}
1791+
}
1792+
#endif
1793+
17781794
getStateMachine()->setState( TAKING_OFF_AWAIT_CLEARANCE );
17791795
}
17801796
else

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,22 @@ UpdateSleepTime ChinookAIUpdate::update()
10931093
{
10941094
// we're completely healed, so take off again
10951095
pp->setHealee(getObject(), false);
1096+
1097+
// TheSuperHackers @bugfix arcticdolphin 08/02/2026 Move healed Chinook to rally point if present.
1098+
#if !RETAIL_COMPATIBLE_CRC
1099+
{
1100+
Object *airfield = TheGameLogic->findObjectByID( m_airfieldForHealing );
1101+
const Coord3D *rp = airfield->getObjectExitInterface()->getRallyPoint();
1102+
if( rp )
1103+
{
1104+
AICommandParms parms( AICMD_MOVE_TO_POSITION, CMD_FROM_AI );
1105+
parms.m_pos = *rp;
1106+
m_pendingCommand.store( parms );
1107+
m_hasPendingCommand = true;
1108+
}
1109+
}
1110+
#endif
1111+
10961112
setMyState(TAKING_OFF, nullptr, nullptr, CMD_FROM_AI);
10971113
}
10981114
else

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ class JetPauseBeforeTakeoffState : public AIFaceState
13471347

13481348
if (ai->getCurrentStateID() != TAXI_TO_TAKEOFF)
13491349
continue;
1350-
1350+
13511351
return otherJet;
13521352
}
13531353
}
@@ -1997,6 +1997,22 @@ UpdateSleepTime JetAIUpdate::update()
19971997
friend_setAllowAirLoco(true);
19981998
getStateMachine()->clear();
19991999
setLastCommandSource( CMD_FROM_AI );
2000+
2001+
// TheSuperHackers @bugfix arcticdolphin 08/02/2026 Move healed helicopter to rally point if present.
2002+
#if !RETAIL_COMPATIBLE_CRC
2003+
{
2004+
Object *airfield = TheGameLogic->findObjectByID( jet->getProducerID() );
2005+
const Coord3D *rp = airfield->getObjectExitInterface()->getRallyPoint();
2006+
if( rp )
2007+
{
2008+
AICommandParms parms( AICMD_MOVE_TO_POSITION, CMD_FROM_AI );
2009+
parms.m_pos = *rp;
2010+
m_mostRecentCommand.store( parms );
2011+
setFlag(HAS_PENDING_COMMAND, true);
2012+
}
2013+
}
2014+
#endif
2015+
20002016
getStateMachine()->setState( TAKING_OFF_AWAIT_CLEARANCE );
20012017
}
20022018
else

0 commit comments

Comments
 (0)