From abbbb229d2570507f72bea5d8ab66919a9e61623 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 11 Nov 2025 15:44:37 -0500 Subject: [PATCH 1/2] bugfix: Fix Gatling Cannon barrels rotating despite insufficient energy --- .../Code/GameEngine/Source/GameLogic/Object/Object.cpp | 9 +++++++++ .../Code/GameEngine/Source/GameLogic/Object/Object.cpp | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp index a9d887a612..ed678ddde6 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -2881,6 +2881,10 @@ Bool Object::isAbleToAttack() const if( testStatus(OBJECT_STATUS_SOLD) ) return false; + // TheSuperHackers @bugfix bobtista 31/10/2025 Fixes Gatling Cannon barrels rotating despite insufficient energy. + if ( isKindOf( KINDOF_POWERED ) && isDisabledByType( DISABLED_UNDERPOWERED ) ) + return false; + //We can't fire if we, as a portable structure, are aptly disabled if ( isKindOf( KINDOF_PORTABLE_STRUCTURE ) || isKindOf( KINDOF_SPAWNS_ARE_THE_WEAPONS )) { @@ -4150,6 +4154,11 @@ void Object::adjustModelConditionForWeaponStatus() // we really don't care, so we just force the issue here. (This might still need tweaking for the pursue state.) conditionToSet = WSF_NONE; } + // TheSuperHackers @bugfix bobtista 11/11/2025 Prevent barrel animation when powered structures are underpowered. + else if ( isKindOf( KINDOF_POWERED ) && isDisabledByType( DISABLED_UNDERPOWERED ) ) + { + conditionToSet = WSF_NONE; + } else { WeaponStatus newStatus = w->getStatus(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 0d932d277e..bc746f54ae 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -3200,6 +3200,10 @@ Bool Object::isAbleToAttack() const if ( isDisabledByType( DISABLED_SUBDUED ) ) return FALSE; // A Microwave Tank is cooking me + // TheSuperHackers @bugfix bobtista 31/10/2025 Fixes Gatling Cannon barrels rotating despite insufficient energy. (#1700) + if ( isKindOf( KINDOF_POWERED ) && isDisabledByType( DISABLED_UNDERPOWERED ) ) + return false; + //We can't fire if we, as a portable structure, are aptly disabled if ( isKindOf( KINDOF_PORTABLE_STRUCTURE ) || isKindOf( KINDOF_SPAWNS_ARE_THE_WEAPONS )) { From e8b36a14c827c30291bf7d337c32e6e04dfd21ee Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Tue, 11 Nov 2025 15:45:31 -0500 Subject: [PATCH 2/2] bugfix: Add CRC guard for Gatling Cannon barrel animation fix --- .../GameEngine/Source/GameLogic/Object/Object.cpp | 4 ++++ .../GameEngine/Source/GameLogic/Object/Object.cpp | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp index ed678ddde6..cbac9d50ea 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -2882,8 +2882,10 @@ Bool Object::isAbleToAttack() const return false; // TheSuperHackers @bugfix bobtista 31/10/2025 Fixes Gatling Cannon barrels rotating despite insufficient energy. +#if !RETAIL_COMPATIBLE_CRC if ( isKindOf( KINDOF_POWERED ) && isDisabledByType( DISABLED_UNDERPOWERED ) ) return false; +#endif //We can't fire if we, as a portable structure, are aptly disabled if ( isKindOf( KINDOF_PORTABLE_STRUCTURE ) || isKindOf( KINDOF_SPAWNS_ARE_THE_WEAPONS )) @@ -4155,10 +4157,12 @@ void Object::adjustModelConditionForWeaponStatus() conditionToSet = WSF_NONE; } // TheSuperHackers @bugfix bobtista 11/11/2025 Prevent barrel animation when powered structures are underpowered. +#if !RETAIL_COMPATIBLE_CRC else if ( isKindOf( KINDOF_POWERED ) && isDisabledByType( DISABLED_UNDERPOWERED ) ) { conditionToSet = WSF_NONE; } +#endif else { WeaponStatus newStatus = w->getStatus(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index bc746f54ae..53985fcf02 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -3200,9 +3200,11 @@ Bool Object::isAbleToAttack() const if ( isDisabledByType( DISABLED_SUBDUED ) ) return FALSE; // A Microwave Tank is cooking me - // TheSuperHackers @bugfix bobtista 31/10/2025 Fixes Gatling Cannon barrels rotating despite insufficient energy. (#1700) + // TheSuperHackers @bugfix bobtista 31/10/2025 Fixes Gatling Cannon barrels rotating despite insufficient energy. +#if !RETAIL_COMPATIBLE_CRC if ( isKindOf( KINDOF_POWERED ) && isDisabledByType( DISABLED_UNDERPOWERED ) ) return false; +#endif //We can't fire if we, as a portable structure, are aptly disabled if ( isKindOf( KINDOF_PORTABLE_STRUCTURE ) || isKindOf( KINDOF_SPAWNS_ARE_THE_WEAPONS )) @@ -4719,6 +4721,13 @@ void Object::adjustModelConditionForWeaponStatus() // we really don't care, so we just force the issue here. (This might still need tweaking for the pursue state.) conditionToSet = WSF_NONE; } + // TheSuperHackers @bugfix bobtista 11/11/2025 Prevent barrel animation when powered structures are underpowered. +#if !RETAIL_COMPATIBLE_CRC + else if ( isKindOf( KINDOF_POWERED ) && isDisabledByType( DISABLED_UNDERPOWERED ) ) + { + conditionToSet = WSF_NONE; + } +#endif else { WeaponStatus newStatus = w->getStatus();