Skip to content

Commit

Permalink
Reset old path in construct() of FindPathToNode
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyTechGuy committed Aug 6, 2019
1 parent 933a75a commit 5fe037a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/terasology/minion/move/FindPathToNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public void construct(final Actor actor) {
if(pathfinderSystem==null){setup();}
final MinionMoveComponent moveComponent = actor.getComponent(MinionMoveComponent.class);
Vector3f targetLocation = moveComponent.target;
moveComponent.path = null;
actor.save(moveComponent);
WalkableBlock currentBlock = moveComponent.currentBlock;
if (currentBlock == null || targetLocation == null) {
moveComponent.path = Path.INVALID;
Expand Down Expand Up @@ -91,7 +93,7 @@ public void onSuccess(List<Path> paths) {
public void onFailure(Throwable t) {
moveComponent.path = Path.INVALID;
}
}, MoreExecutors.directExecutor());
});
}

@Override
Expand Down

0 comments on commit 5fe037a

Please sign in to comment.