diff --git a/src/engine/db/handlers/dbHandlerBase.java b/src/engine/db/handlers/dbHandlerBase.java index 94a25ab2..783a8432 100644 --- a/src/engine/db/handlers/dbHandlerBase.java +++ b/src/engine/db/handlers/dbHandlerBase.java @@ -32,14 +32,7 @@ public abstract class dbHandlerBase { try { if (rs.next()) { abstractGameObject = localClass.getConstructor(ResultSet.class).newInstance(rs); - - if(abstractGameObject.getObjectType().equals(GameObjectType.Zone)){ - if(rs.getInt("canLoad") == 1){ - DbManager.addToCache(abstractGameObject); - } - }else { - DbManager.addToCache(abstractGameObject); - } + DbManager.addToCache(abstractGameObject); } } catch (Exception e) { Logger.error(e); diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index 45314553..0971212f 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -61,6 +61,7 @@ public class Zone extends AbstractGameObject { //public static ArrayList respawnQue = new ArrayList<>(); public static final Set respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>()); public static long lastRespawn = 0; + public int canLoad; /** * ResultSet Constructor */ @@ -101,6 +102,7 @@ public class Zone extends AbstractGameObject { if (hash == null) setHash(); + this.canLoad = rs.getInt("canLoad"); } diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index 85089efb..fffd617c 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -568,6 +568,9 @@ public class WorldServer { for (Zone zone : rootParent) { + if(zone.canLoad == 0) + continue; + try { ZoneManager.addZone(zone.getLoadNum(), zone);