sendUpdatedContainment is no longer attempted to be sent if the object has a null parent

This commit is contained in:
Waverunner
2015-06-06 09:21:35 -04:00
parent cdcfeccae1
commit 078ddc115c
+6 -1
View File
@@ -576,6 +576,9 @@ public abstract class SWGObject implements Serializable, Comparable<SWGObject> {
}
private void sendUpdatedContainment(List<SWGObject> oldObservers, List<SWGObject> newObservers) {
if (parent == null)
return;
List<SWGObject> same = new ArrayList<>(oldObservers);
same.retainAll(newObservers);
@@ -586,7 +589,9 @@ public abstract class SWGObject implements Serializable, Comparable<SWGObject> {
removed.removeAll(newObservers);
for (SWGObject swgObject : same) {
swgObject.sendSelf(new UpdateContainmentMessage(objectId, parent.getObjectId(), slotArrangement));
if (swgObject.getOwner() != null) {
swgObject.sendSelf(new UpdateContainmentMessage(objectId, parent.getObjectId(), slotArrangement));
}
}
for (SWGObject swgObject : added) {