fixed null pointer at disconnect

This commit is contained in:
Light2
2014-03-28 20:36:11 +01:00
parent f0a61f030d
commit 397a35ebad
3 changed files with 5 additions and 3 deletions
@@ -1580,7 +1580,8 @@ public class CreatureObject extends TangibleObject implements IPersistent {
synchronized(objectMutex) {
this.performanceListenee = performanceListenee;
}
getClient().getSession().write(messageBuilder.buildListenToId(performanceListenee.getObjectId()));
if(getClient() != null)
getClient().getSession().write(messageBuilder.buildListenToId(performanceListenee.getObjectId()));
}
+1 -1
View File
@@ -144,8 +144,8 @@ public abstract class AIState {
} else {
newX = currentPathPosition.x;
newY = currentPathPosition.y;
newZ = currentPathPosition.z;
newY = core.terrainService.getHeight(creature.getPlanetId(), newX, newX);
}
oldPosition = currentPathPosition;
}
+2 -1
View File
@@ -76,6 +76,7 @@ public class AttackState extends AIState {
actor.setNextPosition(actor.getFollowObject().getPosition());
else {
//recover(actor);
actor.faceObject(actor.getFollowObject());
actor.scheduleMovement();
return StateResult.UNFINISHED;
}
@@ -136,7 +137,7 @@ public class AttackState extends AIState {
actor.scheduleRecovery();
return StateResult.UNFINISHED;
}
actor.faceObject(target);
//actor.faceObject(target);
Vector<String> attacks = actor.getMobileTemplate().getAttacks();