New avert sprite / Fixed loading of CommandAI positions

This commit is contained in:
Anuken
2022-04-06 10:37:26 -04:00
parent cf25836d76
commit 047c284e48
5 changed files with 13 additions and 6 deletions
+7 -2
View File
@@ -98,8 +98,8 @@ public class CommandAI extends AIController{
}else if(local.size > 1){
int count = 0;
for(var near : local){
//has arrived
if(near.isCommandable() && !near.command().hasCommand() && targetPos.equals(near.command().lastTargetPos)){
//has arrived - no current command, but last one is equal
if(near.isCommandable() && !near.command().hasCommand() && targetPos.epsilonEquals(near.command().lastTargetPos, 0.001f)){
count ++;
}
}
@@ -181,6 +181,11 @@ public class CommandAI extends AIController{
return targetPos != null;
}
public void setupLastPos(){
lastTargetPos = targetPos;
}
public void commandPosition(Vec2 pos){
targetPos = pos;
lastTargetPos = pos;