From 4422182eaeb8bdc5631cbabe175a87fbd9f56054 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 24 Feb 2023 08:34:25 -0500 Subject: [PATCH] Reset logic moved to within method. --- src/engine/gameManager/ZoneManager.java | 8 +++++--- src/engine/workthreads/HourlyJobThread.java | 4 +--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/gameManager/ZoneManager.java b/src/engine/gameManager/ZoneManager.java index f73fbadb..53885f1c 100644 --- a/src/engine/gameManager/ZoneManager.java +++ b/src/engine/gameManager/ZoneManager.java @@ -222,13 +222,15 @@ public enum ZoneManager { if (ZoneManager.macroZones.isEmpty()) return; - for (Zone zone : ZoneManager.macroZones) { + // Reset hotZone availability if none are left. + if (ZoneManager.availableHotZones() == 0) + ZoneManager.resetHotZones(); + + for (Zone zone : ZoneManager.macroZones) if (validHotZone(zone)) zoneArray.add(zone.getObjectUUID()); - } - int entryIndex = ThreadLocalRandom.current().nextInt(zoneArray.size()); hotzone = ZoneManager.getZoneByUUID(zoneArray.get(entryIndex)); diff --git a/src/engine/workthreads/HourlyJobThread.java b/src/engine/workthreads/HourlyJobThread.java index 5500a715..f84e6346 100644 --- a/src/engine/workthreads/HourlyJobThread.java +++ b/src/engine/workthreads/HourlyJobThread.java @@ -192,10 +192,8 @@ public class HourlyJobThread implements Runnable { try { // Reset zone availability at 1am - // or if we run out of hotZones - if (LocalDateTime.now().getHour() == 01 || - ZoneManager.availableHotZones() == 0) + if (LocalDateTime.now().getHour() == 01) ZoneManager.resetHotZones(); // Use the same hotZone this hour up and until