Browse Source

Reset logic moved to within method.

master
MagicBot 2 years ago
parent
commit
4422182eae
  1. 8
      src/engine/gameManager/ZoneManager.java
  2. 4
      src/engine/workthreads/HourlyJobThread.java

8
src/engine/gameManager/ZoneManager.java

@ -222,13 +222,15 @@ public enum ZoneManager {
if (ZoneManager.macroZones.isEmpty()) if (ZoneManager.macroZones.isEmpty())
return; 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)) if (validHotZone(zone))
zoneArray.add(zone.getObjectUUID()); zoneArray.add(zone.getObjectUUID());
}
int entryIndex = ThreadLocalRandom.current().nextInt(zoneArray.size()); int entryIndex = ThreadLocalRandom.current().nextInt(zoneArray.size());
hotzone = ZoneManager.getZoneByUUID(zoneArray.get(entryIndex)); hotzone = ZoneManager.getZoneByUUID(zoneArray.get(entryIndex));

4
src/engine/workthreads/HourlyJobThread.java

@ -192,10 +192,8 @@ public class HourlyJobThread implements Runnable {
try { try {
// Reset zone availability at 1am // Reset zone availability at 1am
// or if we run out of hotZones
if (LocalDateTime.now().getHour() == 01 || if (LocalDateTime.now().getHour() == 01)
ZoneManager.availableHotZones() == 0)
ZoneManager.resetHotZones(); ZoneManager.resetHotZones();
// Use the same hotZone this hour up and until // Use the same hotZone this hour up and until

Loading…
Cancel
Save