From 2bff826a1092aaebc9b10cf303fd4be6c12d8cf4 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 4 Jan 2024 13:51:15 -0500 Subject: [PATCH] Error trap when deranking during maintenance. --- src/engine/gameManager/MaintenanceManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine/gameManager/MaintenanceManager.java b/src/engine/gameManager/MaintenanceManager.java index f92d531e..d4dcf63a 100644 --- a/src/engine/gameManager/MaintenanceManager.java +++ b/src/engine/gameManager/MaintenanceManager.java @@ -59,8 +59,12 @@ public enum MaintenanceManager { // Derak or destroy buildings that did not // have funds available. - for (Building building : derankList) - building.destroyOrDerank(null); + try { + for (Building building : derankList) + building.destroyOrDerank(null); + } catch (Exception e) { + Logger.error(e); + } Logger.info("Structures: " + buildingList.size() + " Maint: " + maintList.size() + " Derank: " + derankList.size()); }