From 5330787013cf1f065410b979f4387acf64362644 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Sun, 15 Mar 2026 17:40:35 +1100 Subject: [PATCH] bugfix: Modules now cease updating when disabled by non-whitelisted disabled types --- .../Source/GameLogic/System/GameLogic.cpp | 16 ++++++++++++++++ .../Source/GameLogic/System/GameLogic.cpp | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index bf20ed2d157..c95bbc2ac23 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -3188,7 +3188,15 @@ void GameLogic::update() { UpdateModulePtr u = *it; DisabledMaskType dis = u->friend_getObject()->getDisabledFlags(); +#if RETAIL_COMPATIBLE_CRC if (!dis.any() || dis.anyIntersectionWith(u->getDisabledTypesToProcess())) +#else + // TheSuperHackers @bugfix Stubbjax 15/03/2026 The disabled-types-to-process mask is now exclusive. + // Previously, if the disabled mask had any bits in common with the disabled-types-to-process mask, + // the update would be processed. Now, if any *other* bits are set in the disabled mask, the update + // is no longer processed. + if (!dis.any() || u->getDisabledTypesToProcess().testForAll(dis)) +#endif { USE_PERF_TIMER(GameLogic_update_normal) @@ -3228,7 +3236,15 @@ void GameLogic::update() UpdateSleepTime sleepLen = UPDATE_SLEEP_NONE; // default, if it is disabled. DisabledMaskType dis = u->friend_getObject()->getDisabledFlags(); +#if RETAIL_COMPATIBLE_CRC if (!dis.any() || dis.anyIntersectionWith(u->getDisabledTypesToProcess())) +#else + // TheSuperHackers @bugfix Stubbjax 15/03/2026 The disabled-types-to-process mask is now exclusive. + // Previously, if the disabled mask had any bits in common with the disabled-types-to-process mask, + // the update would be processed. Now, if any *other* bits are set in the disabled mask, the update + // is no longer processed. + if (!dis.any() || u->getDisabledTypesToProcess().testForAll(dis)) +#endif { USE_PERF_TIMER(GameLogic_update_sleepy) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 1d671f180f5..41ae3a9c0fd 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -3716,7 +3716,15 @@ void GameLogic::update() { UpdateModulePtr u = *it; DisabledMaskType dis = u->friend_getObject()->getDisabledFlags(); +#if RETAIL_COMPATIBLE_CRC if (!dis.any() || dis.anyIntersectionWith(u->getDisabledTypesToProcess())) +#else + // TheSuperHackers @bugfix Stubbjax 15/03/2026 The disabled-types-to-process mask is now exclusive. + // Previously, if the disabled mask had any bits in common with the disabled-types-to-process mask, + // the update would be processed. Now, if any *other* bits are set in the disabled mask, the update + // is no longer processed. + if (!dis.any() || u->getDisabledTypesToProcess().testForAll(dis)) +#endif { USE_PERF_TIMER(GameLogic_update_normal) @@ -3756,7 +3764,15 @@ void GameLogic::update() UpdateSleepTime sleepLen = UPDATE_SLEEP_NONE; // default, if it is disabled. DisabledMaskType dis = u->friend_getObject()->getDisabledFlags(); +#if RETAIL_COMPATIBLE_CRC if (!dis.any() || dis.anyIntersectionWith(u->getDisabledTypesToProcess())) +#else + // TheSuperHackers @bugfix Stubbjax 15/03/2026 The disabled-types-to-process mask is now exclusive. + // Previously, if the disabled mask had any bits in common with the disabled-types-to-process mask, + // the update would be processed. Now, if any *other* bits are set in the disabled mask, the update + // is no longer processed. + if (!dis.any() || u->getDisabledTypesToProcess().testForAll(dis)) +#endif { USE_PERF_TIMER(GameLogic_update_sleepy)