From 79400b6b0efb166f5ffae2d35f6ef3637d06c932 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 4 Jan 2024 13:51:57 -0500 Subject: [PATCH] Error trap when deranking during maintenance. --- src/engine/gameManager/MaintenanceManager.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/engine/gameManager/MaintenanceManager.java b/src/engine/gameManager/MaintenanceManager.java index d4dcf63a..574768d8 100644 --- a/src/engine/gameManager/MaintenanceManager.java +++ b/src/engine/gameManager/MaintenanceManager.java @@ -45,17 +45,15 @@ public enum MaintenanceManager { // Deduct upkeep and build list of buildings // which did not have funds available - for (Building building : maintList) { - + for (Building building : maintList) if (chargeUpkeep(building) == false) derankList.add(building); - } + // Reset maintenance dates for these buildings - for (Building building : maintList) { + for (Building building : maintList) setMaintDateTime(building, LocalDateTime.now().plusDays(7)); - } // Derak or destroy buildings that did not // have funds available.