From 6313182c4ffde1301602f2161b650e5adcae2776 Mon Sep 17 00:00:00 2001
From: FatBoy-DOTC <justin.chucksinsulating@gmail.com>
Date: Tue, 28 May 2024 21:28:06 -0500
Subject: [PATCH] mine window processing

---
 src/engine/workthreads/MineThread.java | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/engine/workthreads/MineThread.java b/src/engine/workthreads/MineThread.java
index ea0e3bf6..9da1bfd5 100644
--- a/src/engine/workthreads/MineThread.java
+++ b/src/engine/workthreads/MineThread.java
@@ -25,7 +25,7 @@ public class MineThread  implements Runnable {
         nextPulse = LocalDateTime.now().withMinute(0).withSecond(0).withNano(0);
         while (true) {
             if(LocalDateTime.now().isAfter(nextPulse)) {
-                processMineWindows();
+                processMineWindows(nextPulse);
             }
         }
     }
@@ -104,16 +104,13 @@ public class MineThread  implements Runnable {
         return true;
     }
 
-    public static void processMineWindows(){
+    public static void processMineWindows(LocalDateTime currentTime){
         for (Mine mine : Mine.getMines()) {
             Building tower = BuildingManager.getBuildingFromCache(mine.getBuildingID());
             //if the tower comes back null, skip this mine
             if(tower == null)
                 continue;
 
-            //log the current time right now
-            LocalDateTime currentTime = LocalDateTime.now().plusMinutes(1);
-
             //check if this mine needs to open
             LocalDateTime openTime = LocalDateTime.now().withHour(mine.liveHour).withMinute(mine.liveMinute).withSecond(0).withNano(0);
             if(currentTime.isAfter(openTime) && currentTime.isBefore(openTime.plusMinutes(30)) && !mine.wasOpened){