From e9fef85b721e3c25bf5a22a99b82c0caea371db3 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 25 Jun 2024 20:21:12 -0500 Subject: [PATCH] set maintenance dates correctly --- src/engine/gameManager/MaintenanceManager.java | 2 +- src/engine/workthreads/HourlyJobThread.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/gameManager/MaintenanceManager.java b/src/engine/gameManager/MaintenanceManager.java index c8265fc6..00b32d95 100644 --- a/src/engine/gameManager/MaintenanceManager.java +++ b/src/engine/gameManager/MaintenanceManager.java @@ -24,7 +24,7 @@ public enum MaintenanceManager { public static void setMaintDateTime(Building building, LocalDateTime maintDate) { - building.maintDateTime = maintDate; + building.maintDateTime = maintDate.withHour(1).withMinute(0).withSecond(0); DbManager.BuildingQueries.updateMaintDate(building); } diff --git a/src/engine/workthreads/HourlyJobThread.java b/src/engine/workthreads/HourlyJobThread.java index 742f7152..56be92ce 100644 --- a/src/engine/workthreads/HourlyJobThread.java +++ b/src/engine/workthreads/HourlyJobThread.java @@ -53,8 +53,8 @@ public class HourlyJobThread implements Runnable { Logger.error("missing city map"); } - //run maintenance every day at 1 am - if(LocalDateTime.now().getHour() == 1) { + //run maintenance every day at 2 am + if(LocalDateTime.now().getHour() == 2) { MaintenanceManager.dailyMaintenance(); //produce mine resources once a day