Added client null check to movement

No idea why client would be null when moving.  Unless their connection
reset and they are disconnected but still trying to send movement
packets.

If the latter is not the case it suggests a serious issue of the client
object being null while they are still connected.
This commit is contained in:
Treeku
2014-06-16 21:40:50 +01:00
parent cda18ac3b7
commit 252c30df21
+3 -1
View File
@@ -526,7 +526,9 @@ public class SimulationService implements INetworkDispatch {
remove(object, oldPos.x, oldPos.z);
if(object.getContainer() != null)
object.getContainer()._remove(object);
if (object.getClient().isGM() && parent != null && parent instanceof CellObject && parent.getContainer() != null)
if (object.getClient() == null)
System.err.println("Client is null! This is a very strange error.");
if (object.getClient() != null && object.getClient().isGM() && parent != null && parent instanceof CellObject && parent.getContainer() != null)
object.sendSystemMessage("BuildingId - Dec: " + parent.getContainer().getObjectID() + " Hex: " + Long.toHexString(parent.getContainer().getObjectID()) + " CellNumber: " + ((CellObject) parent).getCellNumber(), DisplayType.Broadcast);
parent._add(object);
}