Skip to content

Commit 7fd6ae6

Browse files
committed
refactor: exclude power-related disable types from FiringTracker updates in generals
1 parent b95951c commit 7fd6ae6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Generals/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) 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_MASK3(DISABLED_HACKED, DISABLED_EMP, DISABLED_UNDERPOWERED));
66+
return mask;
67+
}
6268

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

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

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

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

0 commit comments

Comments
 (0)