Browse Source

dirtyFlag integration.

master
MagicBot 1 year ago
parent
commit
ca21c3d266
  1. 14
      src/engine/InterestManagement/InterestManager.java
  2. 3
      src/engine/gameManager/BuildingManager.java

14
src/engine/InterestManagement/InterestManager.java

@ -565,4 +565,18 @@ public enum InterestManager implements Runnable { @@ -565,4 +565,18 @@ public enum InterestManager implements Runnable {
Logger.error("InterestManager.updateAllMobilePlayers: " + player.getObjectUUID(), e);
}
}
public static void setObjectDirty(AbstractWorldObject abstractWorldObject) {
HashSet<AbstractWorldObject> playerList = WorldGrid.getObjectsInRangePartial(abstractWorldObject.getLoc(), 128, MBServerStatics.MASK_PLAYER);
if (playerList.isEmpty())
return;
for (AbstractWorldObject playerObject : playerList) {
PlayerCharacter playerCharacter = (PlayerCharacter) playerObject;
playerCharacter.dirtyLoad = true;
}
}
}

3
src/engine/gameManager/BuildingManager.java

@ -12,6 +12,7 @@ package engine.gameManager; @@ -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 { @@ -504,7 +505,7 @@ public enum BuildingManager {
npc.setObjectTypeMask(MBServerStatics.MASK_NPC);
npc.setLoc(npc.bindLoc);
InterestManager.setObjectDirty(npc);
return true;
}

Loading…
Cancel
Save