From c8c644dcc13a5d6ec481d4a98dc6a99626a2a995 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Wed, 19 Nov 2025 11:08:26 -0500 Subject: [PATCH 1/2] bugfix(weapon): fix patriot assist system extended range bug --- .../GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp | 4 ++++ Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 4 ++++ .../GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp | 4 ++++ GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 67cedc7f37..61f1954e3f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -3286,6 +3286,8 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire, if (!victim) { + // TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug + getObject()->releaseWeaponLock(LOCKED_TEMPORARILY); // Hard to kill em if they're already dead. jba return; } @@ -3305,6 +3307,8 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire, void AIUpdateInterface::privateForceAttackObject( Object *victim, Int maxShotsToFire, CommandSourceType cmdSource ) { if (!victim) { + // TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug + getObject()->releaseWeaponLock(LOCKED_TEMPORARILY); return; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index ff1dbf4ed1..99f0cdee0e 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -2756,6 +2756,10 @@ static void makeAssistanceRequest( Object *requestOf, void *userData ) if( requestOf == requestData->m_requestingObject ) return; + // TheSuperHackers @bugfix bobtista Prevent patriot from assisting when it is the target + if( requestOf == requestData->m_victimObject ) + return; + // Only request of our kind of people if( !requestOf->getTemplate()->isEquivalentTo( requestData->m_requestingObject->getTemplate() ) ) return; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 7bc310b7d6..58e3d802ac 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -3423,6 +3423,8 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire, if (!victim) { + // TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug + getObject()->releaseWeaponLock(LOCKED_TEMPORARILY); // Hard to kill em if they're already dead. jba return; } @@ -3442,6 +3444,8 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire, void AIUpdateInterface::privateForceAttackObject( Object *victim, Int maxShotsToFire, CommandSourceType cmdSource ) { if (!victim) { + // TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug + getObject()->releaseWeaponLock(LOCKED_TEMPORARILY); return; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 7720c5cc71..68efbfdfba 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -2967,6 +2967,10 @@ static void makeAssistanceRequest( Object *requestOf, void *userData ) if( requestOf == requestData->m_requestingObject ) return; + // TheSuperHackers @bugfix bobtista Prevent patriot from assisting when it is the target + if( requestOf == requestData->m_victimObject ) + return; + // Only request of our kind of people if( !requestOf->getTemplate()->isEquivalentTo( requestData->m_requestingObject->getTemplate() ) ) return; From c625ff875538cde89af998fd62ca337710d75d96 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Wed, 19 Nov 2025 11:08:53 -0500 Subject: [PATCH 2/2] chore(compat): guard patriot assist fix behind CRC compatibility flag --- .../GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp | 4 ++++ Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 2 ++ .../GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp | 4 ++++ GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 2 ++ 4 files changed, 12 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 61f1954e3f..0c7ee45859 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -3286,8 +3286,10 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire, if (!victim) { +#if !RETAIL_COMPATIBLE_CRC // TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug getObject()->releaseWeaponLock(LOCKED_TEMPORARILY); +#endif // Hard to kill em if they're already dead. jba return; } @@ -3307,8 +3309,10 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire, void AIUpdateInterface::privateForceAttackObject( Object *victim, Int maxShotsToFire, CommandSourceType cmdSource ) { if (!victim) { +#if !RETAIL_COMPATIBLE_CRC // TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug getObject()->releaseWeaponLock(LOCKED_TEMPORARILY); +#endif return; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 99f0cdee0e..f3c35ef0d5 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -2756,9 +2756,11 @@ static void makeAssistanceRequest( Object *requestOf, void *userData ) if( requestOf == requestData->m_requestingObject ) return; +#if !RETAIL_COMPATIBLE_CRC // TheSuperHackers @bugfix bobtista Prevent patriot from assisting when it is the target if( requestOf == requestData->m_victimObject ) return; +#endif // Only request of our kind of people if( !requestOf->getTemplate()->isEquivalentTo( requestData->m_requestingObject->getTemplate() ) ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 58e3d802ac..c0797aeab3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -3423,8 +3423,10 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire, if (!victim) { +#if !RETAIL_COMPATIBLE_CRC // TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug getObject()->releaseWeaponLock(LOCKED_TEMPORARILY); +#endif // Hard to kill em if they're already dead. jba return; } @@ -3444,8 +3446,10 @@ void AIUpdateInterface::privateAttackObject( Object *victim, Int maxShotsToFire, void AIUpdateInterface::privateForceAttackObject( Object *victim, Int maxShotsToFire, CommandSourceType cmdSource ) { if (!victim) { +#if !RETAIL_COMPATIBLE_CRC // TheSuperHackers @bugfix bobtista Reset weapons lock to fix patriot turret extended range bug getObject()->releaseWeaponLock(LOCKED_TEMPORARILY); +#endif return; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 68efbfdfba..4cdd1f81fe 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -2967,9 +2967,11 @@ static void makeAssistanceRequest( Object *requestOf, void *userData ) if( requestOf == requestData->m_requestingObject ) return; +#if !RETAIL_COMPATIBLE_CRC // TheSuperHackers @bugfix bobtista Prevent patriot from assisting when it is the target if( requestOf == requestData->m_victimObject ) return; +#endif // Only request of our kind of people if( !requestOf->getTemplate()->isEquivalentTo( requestData->m_requestingObject->getTemplate() ) )