From b98607e8750a3feffa6e13983c42b91b6d9eec95 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Sat, 24 Jan 2026 00:38:59 +1100 Subject: [PATCH] tweak: Defer offensive commands for parked jets without ammo --- .../Object/Update/AIUpdate/JetAIUpdate.cpp | 21 ++++++++++++++++++ .../Object/Update/AIUpdate/JetAIUpdate.cpp | 22 +++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp index 5e08e1cd8a0..8bdcdac3404 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp @@ -2337,6 +2337,27 @@ void JetAIUpdate::aiDoCommand(const AICommandParms* parms) // don't need (or want) to take off for these break; +#if !RETAIL_COMPATIBLE_CRC + // TheSuperHackers @tweak Stubbjax 23/01/2026 Parked jets now defer offensive commands when out of ammo. + case AICMD_ATTACKMOVE_TO_POSITION: + case AICMD_ATTACK_AREA: + case AICMD_ATTACK_OBJECT: + case AICMD_ATTACK_POSITION: + case AICMD_ATTACK_TEAM: + case AICMD_FORCE_ATTACK_OBJECT: + case AICMD_GUARD_AREA: + case AICMD_GUARD_OBJECT: + case AICMD_GUARD_POSITION: + case AICMD_HUNT: + if (isOutOfSpecialReloadAmmo(getObject())) + { + setFlag(HAS_PENDING_COMMAND, true); + return; + } + + FALLTHROUGH; +#endif + case AICMD_ENTER: case AICMD_GET_REPAIRED: diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp index 101640d9cdd..323f54d08c0 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp @@ -2571,6 +2571,28 @@ void JetAIUpdate::aiDoCommand(const AICommandParms* parms) // don't need (or want) to take off for these break; +#if !RETAIL_COMPATIBLE_CRC + // TheSuperHackers @tweak Stubbjax 23/01/2026 Parked jets now defer offensive commands when out of ammo. + case AICMD_ATTACKMOVE_TO_POSITION: + case AICMD_ATTACK_AREA: + case AICMD_ATTACK_OBJECT: + case AICMD_ATTACK_POSITION: + case AICMD_ATTACK_TEAM: + case AICMD_FORCE_ATTACK_OBJECT: + case AICMD_GUARD_AREA: + case AICMD_GUARD_OBJECT: + case AICMD_GUARD_POSITION: + case AICMD_GUARD_RETALIATE: + case AICMD_HUNT: + if (isOutOfSpecialReloadAmmo()) + { + setFlag(HAS_PENDING_COMMAND, true); + return; + } + + FALLTHROUGH; +#endif + case AICMD_ENTER: case AICMD_GET_REPAIRED: