Fixed CORE-127 'Players will now show up in buildings' (for real this time)

This commit is contained in:
Obique PSWG
2015-08-08 12:23:24 -05:00
parent c081c824c0
commit a67464e23e
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -751,8 +751,9 @@ public abstract class SWGObject implements Serializable, Comparable<SWGObject> {
}
}
public void updateObjectAwareness(List <SWGObject> withinRange) {
public void updateObjectAwareness(Set <SWGObject> withinRange) {
synchronized (objectsAware) {
withinRange.addAll(getObservers());
Set <SWGObject> outOfRange = new HashSet<>(objectsAware);
outOfRange.removeAll(withinRange);
for (SWGObject o : outOfRange) {
+3 -1
View File
@@ -28,9 +28,11 @@
package services.objects;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import network.packets.swg.zone.UpdateContainmentMessage;
import resources.Location;
@@ -139,7 +141,7 @@ public class ObjectAwareness {
Location l = obj.getWorldLocation();
if (invalidLocation(l))
return;
List <SWGObject> objectAware = new LinkedList<SWGObject>();
Set <SWGObject> objectAware = new HashSet<SWGObject>();
QuadTree <SWGObject> tree = getTree(l);
synchronized (tree) {
List <SWGObject> range = tree.getWithinRange(l.getX(), l.getZ(), AWARE_RANGE);