This commit is contained in:
Rseifert 2013-03-01 12:44:49 -05:00
parent ff3ff4ec50
commit 56eb239685

View file

@ -60,16 +60,12 @@ public class Pathfinder
ForgeDirection dir = ForgeDirection.getOrientation(i); ForgeDirection dir = ForgeDirection.getOrientation(i);
Vector3 dirLoc = new Vector3(location.intX() + dir.offsetX, location.intY() + dir.offsetY, location.intZ() + dir.offsetZ); Vector3 dirLoc = new Vector3(location.intX() + dir.offsetX, location.intY() + dir.offsetY, location.intZ() + dir.offsetZ);
if (!searchedNodes.contains(dirLoc)) if (!searchedNodes.contains(dirLoc) && this.isValidNode(dir, dirLoc))
{
if (this.isValidNode(dir, dirLoc))
{ {
if (!this.findNodes(dirLoc)) if (!this.findNodes(dirLoc))
{ {
return false; return false;
} }
}
} }
} }
} }
@ -109,8 +105,8 @@ public class Pathfinder
*/ */
public Pathfinder init(Vector3 start, Vector3 target) public Pathfinder init(Vector3 start, Vector3 target)
{ {
this.findNodes(start);
this.target = target; this.target = target;
this.findNodes(start);
return this; return this;
} }