diff --git a/src/engine/InterestManagement/InterestManager.java b/src/engine/InterestManagement/InterestManager.java index ead4ee32..79a4cc19 100644 --- a/src/engine/InterestManagement/InterestManager.java +++ b/src/engine/InterestManagement/InterestManager.java @@ -565,4 +565,18 @@ public enum InterestManager implements Runnable { Logger.error("InterestManager.updateAllMobilePlayers: " + player.getObjectUUID(), e); } } + + public static void setObjectDirty(AbstractWorldObject abstractWorldObject) { + + HashSet playerList = WorldGrid.getObjectsInRangePartial(abstractWorldObject.getLoc(), 128, MBServerStatics.MASK_PLAYER); + + if (playerList.isEmpty()) + return; + + for (AbstractWorldObject playerObject : playerList) { + + PlayerCharacter playerCharacter = (PlayerCharacter) playerObject; + playerCharacter.dirtyLoad = true; + } + } } \ No newline at end of file diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index 6ccb65e6..29952642 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -12,6 +12,7 @@ package engine.gameManager; import engine.Enum; import engine.Enum.BuildingGroup; import engine.Enum.GameObjectType; +import engine.InterestManagement.InterestManager; import engine.InterestManagement.WorldGrid; import engine.job.JobContainer; import engine.job.JobScheduler; @@ -504,7 +505,7 @@ public enum BuildingManager { npc.setObjectTypeMask(MBServerStatics.MASK_NPC); npc.setLoc(npc.bindLoc); - + InterestManager.setObjectDirty(npc); return true; }