From 4c625cdfbf1072dea2fb106115cda34d50ac1dab Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 23 Feb 2023 16:46:55 -0500 Subject: [PATCH] HotZone minLevel enforced. --- src/engine/gameManager/ZoneManager.java | 15 +++++++++------ src/engine/objects/Zone.java | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/engine/gameManager/ZoneManager.java b/src/engine/gameManager/ZoneManager.java index d801bdda..147affe2 100644 --- a/src/engine/gameManager/ZoneManager.java +++ b/src/engine/gameManager/ZoneManager.java @@ -226,13 +226,16 @@ public enum ZoneManager { if (zone.equals(ZoneManager.seaFloor)) return false; - //no duplicate hotzones - if (zone.hasBeenHotzone == true) { + + //no duplicate hotZones + + if (zone.hasBeenHotzone == true) + return false; + + // Enforce min level + + if (zone.minLvl < Integer.parseInt(ConfigManager.MB_HOTZONE_MIN_LEVEL.getValue())) return false; - } - // return false; //first time setting, accept it - // if (this.hotzone.getUUID() == zone.getUUID()) - // return true; //no same hotzone if (ZoneManager.hotZone != null) return ZoneManager.hotZone.getObjectUUID() != zone.getObjectUUID(); diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index a758279d..c1b9389e 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -51,8 +51,8 @@ public class Zone extends AbstractGameObject { private boolean isNPCCity = false; private boolean isPlayerCity = false; private String hash; - private int minLvl; - private int maxLvl; + public int minLvl; + public int maxLvl; private float worldAltitude = 0;