Reset logic moved to within method.

This commit is contained in:
2023-02-24 08:34:25 -05:00
parent 7a2c0d3456
commit 4422182eae
2 changed files with 6 additions and 6 deletions
+5 -3
View File
@@ -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));
+1 -3
View File
@@ -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