LOL
This commit is contained in:
parent
347a269c4d
commit
8ff57fda63
3 changed files with 12 additions and 11 deletions
|
|
@ -84,7 +84,7 @@ public abstract class Unit extends GameEntity{
|
|||
public void move(int x, int y) {
|
||||
path = (LinkedList<AStarNode>) new AStar().startSearch(oldPos,new Vector2i(x,y));
|
||||
|
||||
if(path != null && !path.isEmpty()){
|
||||
if(path != null && !path.isEmpty() && moveTo == null){
|
||||
AStarNode temp = path.poll();
|
||||
moveTo = Map.getPixelByPos(temp.getX(), temp.getY());
|
||||
setPos(temp.getX(), temp.getY());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue