Skip to content

Commit a3fe6c4

Browse files
authored
bugfix(gamelogic): Modules now cease updating when disabled by non-whitelisted disabled types (#2458)
1 parent 022b9a3 commit a3fe6c4

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3253,7 +3253,15 @@ void GameLogic::update()
32533253
{
32543254
UpdateModulePtr u = *it;
32553255
DisabledMaskType dis = u->friend_getObject()->getDisabledFlags();
3256+
#if RETAIL_COMPATIBLE_CRC
32563257
if (!dis.any() || dis.anyIntersectionWith(u->getDisabledTypesToProcess()))
3258+
#else
3259+
// TheSuperHackers @bugfix Stubbjax 15/03/2026 The disabled-types-to-process mask is now exclusive.
3260+
// Previously, if the disabled mask had any bits in common with the disabled-types-to-process mask,
3261+
// the update would be processed. Now, if any *other* bits are set in the disabled mask, the update
3262+
// is no longer processed.
3263+
if (u->getDisabledTypesToProcess().testForAll(dis))
3264+
#endif
32573265
{
32583266
USE_PERF_TIMER(GameLogic_update_normal)
32593267

@@ -3293,7 +3301,15 @@ void GameLogic::update()
32933301
UpdateSleepTime sleepLen = UPDATE_SLEEP_NONE; // default, if it is disabled.
32943302

32953303
DisabledMaskType dis = u->friend_getObject()->getDisabledFlags();
3304+
#if RETAIL_COMPATIBLE_CRC
32963305
if (!dis.any() || dis.anyIntersectionWith(u->getDisabledTypesToProcess()))
3306+
#else
3307+
// TheSuperHackers @bugfix Stubbjax 15/03/2026 The disabled-types-to-process mask is now exclusive.
3308+
// Previously, if the disabled mask had any bits in common with the disabled-types-to-process mask,
3309+
// the update would be processed. Now, if any *other* bits are set in the disabled mask, the update
3310+
// is no longer processed.
3311+
if (u->getDisabledTypesToProcess().testForAll(dis))
3312+
#endif
32973313
{
32983314
USE_PERF_TIMER(GameLogic_update_sleepy)
32993315

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3792,7 +3792,15 @@ void GameLogic::update()
37923792
{
37933793
UpdateModulePtr u = *it;
37943794
DisabledMaskType dis = u->friend_getObject()->getDisabledFlags();
3795+
#if RETAIL_COMPATIBLE_CRC
37953796
if (!dis.any() || dis.anyIntersectionWith(u->getDisabledTypesToProcess()))
3797+
#else
3798+
// TheSuperHackers @bugfix Stubbjax 15/03/2026 The disabled-types-to-process mask is now exclusive.
3799+
// Previously, if the disabled mask had any bits in common with the disabled-types-to-process mask,
3800+
// the update would be processed. Now, if any *other* bits are set in the disabled mask, the update
3801+
// is no longer processed.
3802+
if (u->getDisabledTypesToProcess().testForAll(dis))
3803+
#endif
37963804
{
37973805
USE_PERF_TIMER(GameLogic_update_normal)
37983806

@@ -3832,7 +3840,15 @@ void GameLogic::update()
38323840
UpdateSleepTime sleepLen = UPDATE_SLEEP_NONE; // default, if it is disabled.
38333841

38343842
DisabledMaskType dis = u->friend_getObject()->getDisabledFlags();
3843+
#if RETAIL_COMPATIBLE_CRC
38353844
if (!dis.any() || dis.anyIntersectionWith(u->getDisabledTypesToProcess()))
3845+
#else
3846+
// TheSuperHackers @bugfix Stubbjax 15/03/2026 The disabled-types-to-process mask is now exclusive.
3847+
// Previously, if the disabled mask had any bits in common with the disabled-types-to-process mask,
3848+
// the update would be processed. Now, if any *other* bits are set in the disabled mask, the update
3849+
// is no longer processed.
3850+
if (u->getDisabledTypesToProcess().testForAll(dis))
3851+
#endif
38363852
{
38373853
USE_PERF_TIMER(GameLogic_update_sleepy)
38383854

0 commit comments

Comments
 (0)