From 0eb8da855dc995e510cc2ea40da5a0d9d0d0e17a Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 29 May 2024 19:16:03 -0500 Subject: [PATCH] maintenance resolution --- src/engine/gameManager/MaintenanceManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/gameManager/MaintenanceManager.java b/src/engine/gameManager/MaintenanceManager.java index b9acd9b9..e7f48e7b 100644 --- a/src/engine/gameManager/MaintenanceManager.java +++ b/src/engine/gameManager/MaintenanceManager.java @@ -88,7 +88,7 @@ public enum MaintenanceManager { maintenanceDue = 0; strongboxGold -= maintenanceDue; tol.setStrongboxValue(strongboxGold); //update strongbox value - setMaintDateTime(tol, tol.maintDateTime.plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today + setMaintDateTime(tol, LocalDateTime.now().plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today return; //maintenance is paid, all done } else { maintenanceDue -= strongboxGold; @@ -106,7 +106,7 @@ public enum MaintenanceManager { warehouseGold -= maintenanceDue; warehouse.getResources().put(ItemBase.getItemBase(7),warehouseGold); DbManager.WarehouseQueries.updateGold(warehouse, warehouseGold); - setMaintDateTime(tol, tol.maintDateTime.plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today + setMaintDateTime(tol, LocalDateTime.now().plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today //maintenance is paid, all done } else { //failed maintenance, derank asset @@ -161,7 +161,7 @@ public enum MaintenanceManager { warehouse.getResources().put(ItemBase.getItemBase(1580004), lumberLeft); warehouse.getResources().put(ItemBase.getItemBase(1580000), stoneLeft); warehouse.getResources().put(ItemBase.getItemBase(1580018), wormwoodLeft); - setMaintDateTime(tol, tol.maintDateTime.plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today + setMaintDateTime(tol, LocalDateTime.now().plusDays(7)); //maintenance paid, set next maintenance date for 1 week from today }else{ HandleMaintenanceDerank(tol);//handle derank or potential destruction of the city } @@ -169,7 +169,7 @@ public enum MaintenanceManager { } public static void HandleMaintenanceDerank(Building tol){ - setMaintDateTime(tol, tol.maintDateTime.plusDays(1)); //failed to pay maintenance, set next date for tomorrow + setMaintDateTime(tol, LocalDateTime.now().plusDays(1)); //failed to pay maintenance, set next date for tomorrow tol.destroyOrDerank(null); } }