From 1448ee0cbbe12dd94b8b9b7b383f7e7d6120de39 Mon Sep 17 00:00:00 2001 From: rftrdev <102184004+rftrdev@users.noreply.github.com> Date: Wed, 19 Oct 2022 11:26:01 -0700 Subject: [PATCH] Prevent toggling on admin actions when the player has too few supplies Fix toggle check in daily update --- Strategic/Rebel Command.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Strategic/Rebel Command.cpp b/Strategic/Rebel Command.cpp index f5de19bc..13de9e87 100644 --- a/Strategic/Rebel Command.cpp +++ b/Strategic/Rebel Command.cpp @@ -918,6 +918,9 @@ void SetupAdminActionBox(const UINT8 actionIndex, const UINT16 descriptionText, RenderWebsite(); }); + if (rebelCommandSaveInfo.iSupplies <= 0) + DisableButton(btnId); + MSYS_SetBtnUserData( btnId, 0, iCurrentRegionId ); MSYS_SetBtnUserData( btnId, 1, actionIndex ); @@ -3565,7 +3568,6 @@ void DailyUpdate() // what gets subtracted? current balance? daily income? how do we pick? // get regional bonuses - const INT32 supplyUpkeep = static_cast(gRebelCommandSettings.fIncomeModifier + 0.5f); INT16 intelGain = 0; INT16 supplyGain = 0; INT16 moneyGain = 0; @@ -3602,7 +3604,7 @@ void DailyUpdate() const INT8 level = rebelCommandSaveInfo.regions[a].GetLevel(b); if (level == 0) continue; - if (CanAdminActionBeToggled(rebelCommandSaveInfo.regions[a].actions[b]) && !rebelCommandSaveInfo.regions[a].IsActive(b)) continue; + if (!CanAdminActionBeToggled(rebelCommandSaveInfo.regions[a].actions[b]) || !rebelCommandSaveInfo.regions[a].IsActive(b)) continue; // toggle admin action off on a negative supply balance if (rebelCommandSaveInfo.iSupplies <= 0)