From a3dcc1ef7fd44a8cd3a93271aa111c46d50f87f5 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 e515ff54a4..b0c1ab7954 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 65439088f0..9ec42a2302 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -2746,6 +2746,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 2200bfd823..f4292154f4 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -3427,6 +3427,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; } @@ -3446,6 +3448,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 5c761a654c..6d770eb419 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -2957,6 +2957,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 f182b1990cbb0fb6f4fa514e7bef5d5d901773b1 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 b0c1ab7954..917e535efe 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 9ec42a2302..45f7f19e16 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -2746,9 +2746,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 f4292154f4..ca70355e24 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -3427,8 +3427,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; } @@ -3448,8 +3450,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 6d770eb419..a9f5483f20 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -2957,9 +2957,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() ) )