..
This commit is contained in:
parent
ff3ff4ec50
commit
56eb239685
1 changed files with 5 additions and 9 deletions
|
@ -60,15 +60,11 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue