Fix possible NPE in searching code.

This commit is contained in:
Christian 2013-09-02 15:44:27 -04:00
parent 7246914605
commit 5c334d7627

View file

@ -46,7 +46,7 @@
+ if (this.attacker.getNavigator().getPath() != null) + if (this.attacker.getNavigator().getPath() != null)
+ { + {
+ PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint(); + PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint();
+ if (entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) + if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1)
+ { + {
+ failedPathFindingPenalty = 0; + failedPathFindingPenalty = 0;
+ } + }