dirtyFlag integration.

This commit is contained in:
2023-08-20 19:07:26 -04:00
parent c1f613a1a5
commit ca21c3d266
2 changed files with 16 additions and 1 deletions
@@ -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;
}
}
}
+2 -1
View File
@@ -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;
}