Skip to content

Commit ab5e59e

Browse files
committed
fix: add CRC guards to prevent replay mismatches
1 parent 8361fbf commit ab5e59e

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

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

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

60+
#if !RETAIL_COMPATIBLE_CRC
6061
/// Exclude power-related disable types so update() doesn't restart barrel animations.
6162
/// forceCoolDown() in setDisabledUntil() handles immediate cooldown.
6263
virtual DisabledMaskType getDisabledTypesToProcess() const
@@ -65,6 +66,10 @@ class FiringTracker : public UpdateModule
6566
mask.clear(MAKE_DISABLED_MASK3(DISABLED_HACKED, DISABLED_EMP, DISABLED_UNDERPOWERED));
6667
return mask;
6768
}
69+
#else
70+
/// this is never disabled, since we want disabled things to continue to slowly "spin down"... (srj)
71+
virtual DisabledMaskType getDisabledTypesToProcess() const { return DISABLEDMASK_ALL; }
72+
#endif
6873

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,6 +2025,7 @@ void Object::setDisabledUntil( DisabledType type, UnsignedInt frame )
20252025

20262026
}
20272027

2028+
#if !RETAIL_COMPATIBLE_CRC
20282029
// TheSuperHackers @bugfix bobtista 21/12/2025 Fix Gatling Cannon barrels rotating despite insufficient energy.
20292030
// When power is lost (UNDERPOWERED, EMP, HACKED), immediately force FiringTracker cooldown to stop barrel animations.
20302031
// getDisabledTypesToProcess() prevents update() from restarting animations, and isUnderpoweredForAttack() prevents cursor/attack logic.
@@ -2036,6 +2037,7 @@ void Object::setDisabledUntil( DisabledType type, UnsignedInt frame )
20362037
m_firingTracker->forceCoolDown();
20372038
}
20382039
}
2040+
#endif
20392041

20402042
// This will only be called if we were NOT disabled before coming into this function.
20412043
if (edgeCase) {

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

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

60+
#if !RETAIL_COMPATIBLE_CRC
6061
/// Exclude power-related disable types so update() doesn't restart barrel animations.
6162
/// forceCoolDown() in setDisabledUntil() handles immediate cooldown.
6263
virtual DisabledMaskType getDisabledTypesToProcess() const
@@ -65,6 +66,10 @@ class FiringTracker : public UpdateModule
6566
mask.clear(MAKE_DISABLED_MASK4(DISABLED_HACKED, DISABLED_EMP, DISABLED_UNDERPOWERED, DISABLED_SUBDUED));
6667
return mask;
6768
}
69+
#else
70+
/// this is never disabled, since we want disabled things to continue to slowly "spin down"... (srj)
71+
virtual DisabledMaskType getDisabledTypesToProcess() const { return DISABLEDMASK_ALL; }
72+
#endif
6873

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,6 +2257,7 @@ void Object::setDisabledUntil( DisabledType type, UnsignedInt frame )
22572257

22582258
}
22592259

2260+
#if !RETAIL_COMPATIBLE_CRC
22602261
// TheSuperHackers @bugfix bobtista 21/12/2025 Fix Gatling Cannon barrels rotating despite insufficient energy.
22612262
// When power is lost (UNDERPOWERED, EMP, SUBDUED, HACKED), immediately force FiringTracker cooldown to stop barrel animations.
22622263
// getDisabledTypesToProcess() prevents update() from restarting animations, and isUnderpoweredForAttack() prevents cursor/attack logic.
@@ -2268,6 +2269,7 @@ void Object::setDisabledUntil( DisabledType type, UnsignedInt frame )
22682269
m_firingTracker->forceCoolDown();
22692270
}
22702271
}
2272+
#endif
22712273

22722274
// This will only be called if we were NOT disabled before coming into this function.
22732275
if (edgeCase) {

0 commit comments

Comments
 (0)