Fixed null pointer in ObjectAwareness for buildout areas

This commit is contained in:
Obique PSWG
2016-03-06 12:13:44 -06:00
parent 46cd3c2e75
commit f5792f7a25
+6 -2
View File
@@ -198,10 +198,14 @@ public class ObjectAwareness extends Service {
transform.setSpeed((float) (obj.getMovementScale()*7.3));
}
BuildoutArea area = obj.getBuildoutArea();
area.adjustLocation(newLocation);
if (area == null)
System.err.println("Unknown buildout area at: " + obj.getWorldLocation());
else
newLocation = area.adjustLocation(newLocation);
new PlayerTransformedIntent(obj, obj.getParent(), null, obj.getLocation(), newLocation).broadcast();
move(obj, newLocation, true);
area.readjustLocation(newLocation);
if (area != null)
newLocation = area.readjustLocation(newLocation);
obj.sendDataTransforms(transform);
}