diff --git a/src/services/objects/ObjectManager.java b/src/services/objects/ObjectManager.java index 4bc8ef43b..fea08bde4 100644 --- a/src/services/objects/ObjectManager.java +++ b/src/services/objects/ObjectManager.java @@ -145,37 +145,13 @@ public class ObjectManager extends Manager { addObjectAttributes(obj, template); obj.setTemplate(template); obj.setLocation(l); - addToQuadtree(obj, l); -// moveObject(obj, null, l); +// addToQuadtree(obj, l); + moveObject(obj, null, l); objects.put(objectId, obj); return obj; } } - // Adds an object to the quadtree and refreshes awareness lists in the object added as well as adds the Player to objects in range (if there is one) - private void addToQuadtree(SWGObject obj, Location loc) { - if (loc == null || loc.isNaN()) // Object is inside a container or it's a slot of an item - return; - - double x = loc.getX(), z = loc.getY(); - - List awarePlayers = new ArrayList(); - - QuadTree tree = quadTree.get(loc.getTerrain()); - for (SWGObject inRange : tree.getWithinRange(x, z, AWARE_RANGE)) { - if (inRange != null && inRange.getOwner() != null && inRange.getObjectId() != obj.getObjectId()) { - if (obj.getOwner() != null) - inRange.updateAwareness(obj.getOwner(), true); - - awarePlayers.add(inRange.getOwner()); - } - } - if (awarePlayers.size() > 0) - obj.updateAwareness(awarePlayers); - - quadTree.get(loc.getTerrain()).put(x, z, obj); - } - private void moveObject(SWGObject obj, Location oldLocation, Location newLocation) { if (oldLocation != null && oldLocation.getTerrain() != null) { // Remove from QuadTree double x = oldLocation.getX();