diff --git a/src/engine/InterestManagement/InterestManager.java b/src/engine/InterestManagement/InterestManager.java index be533fac..0f90cd6f 100644 --- a/src/engine/InterestManagement/InterestManager.java +++ b/src/engine/InterestManagement/InterestManager.java @@ -236,7 +236,7 @@ public enum InterestManager implements Runnable { if (distanceSquared > sqr(25)) player.setLastStaticLoc(player.getLoc()); - else if (player.dirtyLoad == false) + else if (player.dirtyLoad.get() == false) return; // Get Statics in range @@ -314,7 +314,7 @@ public enum InterestManager implements Runnable { } loadedStaticObjects.addAll(toLoad); - player.dirtyLoad = false; + player.dirtyLoad.set(false); } private void updateMobileList(PlayerCharacter player, ClientConnection origin) { @@ -522,7 +522,7 @@ public enum InterestManager implements Runnable { //Update static list try { - player.dirtyLoad = true; + player.dirtyLoad.set(true); updateStaticList(player, origin); } catch (Exception e) { Logger.error("InterestManager.updateAllStaticPlayers: " + player.getObjectUUID(), e); @@ -550,7 +550,7 @@ public enum InterestManager implements Runnable { //Update static list try { - playerCharacter.dirtyLoad = true; + playerCharacter.dirtyLoad.set(true); updateStaticList(playerCharacter, origin); } catch (Exception e) { Logger.error("InterestManager.updateAllStaticPlayers: " + playerCharacter.getObjectUUID(), e); @@ -575,7 +575,7 @@ public enum InterestManager implements Runnable { for (AbstractWorldObject playerObject : playerList) { PlayerCharacter playerCharacter = (PlayerCharacter) playerObject; - playerCharacter.dirtyLoad = true; + playerCharacter.dirtyLoad.set(true); } } } \ No newline at end of file diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 2842ba5a..85c6f2cb 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -49,6 +49,7 @@ import java.sql.SQLException; import java.util.*; import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; @@ -180,7 +181,7 @@ public class PlayerCharacter extends AbstractCharacter { private float characterHeight = 0; private boolean lastSwimming = false; private boolean isTeleporting = false; - public boolean dirtyLoad = true; + public AtomicBoolean dirtyLoad = new AtomicBoolean(true); /** * No Id Constructor