From 4b8e0cb04168cc0481a8c8b3ef1b4ec68c7be213 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 11 Jan 2023 16:27:01 -0500 Subject: [PATCH] Bump old opendate during reboot to current +1 when mine window has passed. --- src/engine/objects/Mine.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index de26a814..39564bd2 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -147,7 +147,12 @@ public class Mine extends AbstractGameObject { if (mineOpenDateTime != null) this.openDate = mineOpenDateTime.toLocalDateTime(); - + + // Set opendate to tomorrow if window has passed + + if (LocalDateTime.now().isAfter(this.openDate.plusHours(1))) + this.openDate = LocalDateTime.now().plusDays(1).withHour(this.openDate.getHour()).withMinute(0).withSecond(0).withNano(0); + } public static void SendMineAttackMessage(Building mine){