Fixed path NPE

This commit is contained in:
Calclavia 2013-08-04 18:22:33 -04:00
parent e189636464
commit 48fee60770

View file

@ -532,8 +532,14 @@ public class TileEntityEMContractor extends TileEntityBase implements IPacketRec
if (this.linked != null) if (this.linked != null)
{ {
this.pathfinder = new PathfinderEMContractor(this.worldObj, new Vector3(this.linked).translate(new Vector3(this.linked.getDirection()))); Vector3 start = new Vector3(this).translate(new Vector3(this.getDirection()));
this.pathfinder.find(new Vector3(this).translate(new Vector3(this.getDirection()))); Vector3 target = new Vector3(this.linked).translate(new Vector3(this.linked.getDirection()));
if (TileEntityEMContractor.canBePath(this.worldObj, start) && TileEntityEMContractor.canBePath(this.worldObj, target))
{
this.pathfinder = new PathfinderEMContractor(this.worldObj, target);
this.pathfinder.find(start);
}
} }
} }