@@ -1569,6 +1569,16 @@ Bool Object::isLogicallyVisible() const
15691569// =============================================================================
15701570// Object::isLocallyControlled
15711571// =============================================================================
1572+ Bool Object::isUnderpoweredForAttack () const
1573+ {
1574+ #if !RETAIL_COMPATIBLE_CRC
1575+ return isKindOf ( KINDOF_POWERED ) && isDisabledByType ( DISABLED_UNDERPOWERED );
1576+ #else
1577+ return false ;
1578+ #endif
1579+ }
1580+
1581+ // -------------------------------------------------------------------------------------------------
15721582Bool Object::isLocallyControlled () const
15731583{
15741584 return getControllingPlayer () == ThePlayerList->getLocalPlayer ();
@@ -2015,10 +2025,16 @@ void Object::setDisabledUntil( DisabledType type, UnsignedInt frame )
20152025
20162026 }
20172027
2018- // TheSuperHackers @bugfix bobtista 21/12/2025 Force FiringTracker to cool down immediately when power is lost to prevent delayed barrel animations.
2019- if (m_firingTracker && (type == DISABLED_UNDERPOWERED || type == DISABLED_EMP || type == DISABLED_HACKED))
2028+ // TheSuperHackers @bugfix bobtista 21/12/2025 Fix Gatling Cannon barrels rotating despite insufficient energy.
2029+ // When power is lost (UNDERPOWERED, EMP, HACKED), immediately force FiringTracker cooldown to stop barrel animations.
2030+ // getDisabledTypesToProcess() prevents update() from restarting animations, and isUnderpoweredForAttack() prevents cursor/attack logic.
2031+ if (m_firingTracker)
20202032 {
2021- m_firingTracker->forceCoolDown ();
2033+ Bool isPowerDisableType = (type == DISABLED_UNDERPOWERED || type == DISABLED_EMP || type == DISABLED_HACKED);
2034+ if (isPowerDisableType)
2035+ {
2036+ m_firingTracker->forceCoolDown ();
2037+ }
20222038 }
20232039
20242040 // This will only be called if we were NOT disabled before coming into this function.
@@ -2924,9 +2940,8 @@ Bool Object::isAbleToAttack() const
29242940 if ( testStatus (OBJECT_STATUS_SOLD) )
29252941 return false ;
29262942
2927- // TheSuperHackers @bugfix bobtista 31/10/2025 Fixes Gatling Cannon barrels rotating despite insufficient energy.
29282943#if !RETAIL_COMPATIBLE_CRC
2929- if ( isKindOf ( KINDOF_POWERED ) && isDisabledByType ( DISABLED_UNDERPOWERED ) )
2944+ if (isUnderpoweredForAttack () )
29302945 return false ;
29312946#endif
29322947
@@ -4199,9 +4214,8 @@ void Object::adjustModelConditionForWeaponStatus()
41994214 // we really don't care, so we just force the issue here. (This might still need tweaking for the pursue state.)
42004215 conditionToSet = WSF_NONE;
42014216 }
4202- // TheSuperHackers @bugfix bobtista 11/11/2025 Prevent barrel animation when powered structures are underpowered.
42034217#if !RETAIL_COMPATIBLE_CRC
4204- else if ( isKindOf ( KINDOF_POWERED ) && isDisabledByType ( DISABLED_UNDERPOWERED ) )
4218+ else if (isUnderpoweredForAttack () )
42054219 {
42064220 conditionToSet = WSF_NONE;
42074221 }
@@ -4229,9 +4243,8 @@ void Object::adjustModelConditionForWeaponStatus()
42294243 if (newStatus == READY_TO_FIRE && conditionToSet == WSF_NONE && testStatus ( OBJECT_STATUS_IS_ATTACKING ) &&
42304244 (testStatus ( OBJECT_STATUS_IS_AIMING_WEAPON ) || testStatus ( OBJECT_STATUS_IS_FIRING_WEAPON )))
42314245 {
4232- // TheSuperHackers @bugfix bobtista 11/11/2025 Don't resume firing animation if underpowered.
42334246#if !RETAIL_COMPATIBLE_CRC
4234- if ( !( isKindOf ( KINDOF_POWERED ) && isDisabledByType ( DISABLED_UNDERPOWERED ) ) )
4247+ if (! isUnderpoweredForAttack () )
42354248 {
42364249 conditionToSet = WSF_BETWEEN;
42374250 }
0 commit comments