Fixed armored duct blending / Fixed some pathfinding bugs

This commit is contained in:
Anuken
2024-10-07 12:36:40 -04:00
parent ef33a05cb8
commit 1f62892e10
5 changed files with 18 additions and 12 deletions
+10 -4
View File
@@ -1100,6 +1100,10 @@ public class ControlPathfinder implements Runnable{
}
public boolean getPathPosition(Unit unit, Vec2 destination, Vec2 mainDestination, Vec2 out, @Nullable boolean[] noResultFound){
if(noResultFound != null){
noResultFound[0] = false;
}
int costId = unit.type.pathCostId;
PathCost cost = idToCost(costId);
@@ -1253,7 +1257,11 @@ public class ControlPathfinder implements Runnable{
return true;
}
}
}else if(request == null){
}else{
//destroy the old one immediately, it's invalid now
if(request != null){
request.lastUpdateId = -1000;
}
//queue new request.
unitRequests.put(unit, request = new PathRequest(unit, team, costId, destPos));
@@ -1266,9 +1274,7 @@ public class ControlPathfinder implements Runnable{
recalculatePath(f);
});
out.set(destination);
return true;
return false;
}
if(noResultFound != null){