From f77beb8416b237d80634da8b3255ad7ca88b6f51 Mon Sep 17 00:00:00 2001 From: "seer-by-sentry[bot]" <157164994+seer-by-sentry[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 14:15:56 +0000 Subject: [PATCH] Fix: Prevent power disable on objects with unready modules --- Generals/Code/GameEngine/Source/Common/RTS/Player.cpp | 2 +- GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp index 57269af6531..42175ef4377 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -2772,7 +2772,7 @@ Bool Player::hasRadar() const static void doPowerDisable( Object *obj, void *userData ) { Bool disabling = *((Bool*)userData); - if( obj && obj->isKindOf(KINDOF_POWERED) ) + if( obj && obj->areModulesReady() && obj->isKindOf(KINDOF_POWERED) ) { if( disabling ) obj->setDisabled( DISABLED_UNDERPOWERED ); //set disabled has a pauseAllSpecialPowers that prevents double pausing diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp index 958f9870ac2..a04f38a1782 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -3249,7 +3249,7 @@ Bool Player::hasRadar() const static void doPowerDisable( Object *obj, void *userData ) { Bool disabling = *((Bool*)userData); - if( obj && obj->isKindOf(KINDOF_POWERED) ) + if( obj && obj->areModulesReady() && obj->isKindOf(KINDOF_POWERED) ) { if( disabling ) obj->setDisabled( DISABLED_UNDERPOWERED ); //set disabled has a pauseAllSpecialPowers that prevents double pausing