Skip to content

Commit b95951c

Browse files
committed
refactor: exclude power-related disable types from FiringTracker updates
1 parent 8db4ba7 commit b95951c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

GeneralsMD/Code/GameEngine/Include/GameLogic/FiringTracker.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,14 @@ class FiringTracker : public UpdateModule
5757
Int getNumConsecutiveShotsAtVictim( const Object *victim ) const;
5858
void forceCoolDown(); ///< Force immediate cooldown, stopping all continuous fire states
5959

60-
/// this is never disabled, since we want disabled things to continue to slowly "spin down"... (srj)
61-
virtual DisabledMaskType getDisabledTypesToProcess() const { return DISABLEDMASK_ALL; }
60+
/// Exclude power-related disable types (UNDERPOWERED, EMP, HACKED, SUBDUED) so update() isn't called when disabled.
61+
/// forceCoolDown() in Object::setDisabledUntil() handles immediate cooldown. Other types allow "spin down".
62+
virtual DisabledMaskType getDisabledTypesToProcess() const
63+
{
64+
DisabledMaskType mask = DISABLEDMASK_ALL;
65+
mask.clear(MAKE_DISABLED_MASK4(DISABLED_HACKED, DISABLED_EMP, DISABLED_UNDERPOWERED, DISABLED_SUBDUED));
66+
return mask;
67+
}
6268

6369
virtual UpdateSleepTime update(); ///< See if spin down is needed because we haven't shot in a while
6470

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,6 +2248,7 @@ void Object::setDisabledUntil( DisabledType type, UnsignedInt frame )
22482248
}
22492249

22502250
// TheSuperHackers @bugfix bobtista 21/12/2025 Force FiringTracker to cool down immediately when power is lost to prevent delayed barrel animations.
2251+
// FiringTracker::getDisabledTypesToProcess() excludes these types, but we still need forceCoolDown() for immediate cooldown.
22512252
if (m_firingTracker && (type == DISABLED_UNDERPOWERED || type == DISABLED_EMP || type == DISABLED_SUBDUED || type == DISABLED_HACKED))
22522253
{
22532254
m_firingTracker->forceCoolDown();

0 commit comments

Comments
 (0)