Pathfinder fixes / Hail resprite by Snake#2132 on Discord

This commit is contained in:
Anuken
2023-05-20 10:40:33 -04:00
parent 7c52444e3c
commit 94fe92d67d
3 changed files with 9 additions and 3 deletions

View File

@@ -54,7 +54,10 @@ public class ControlPathfinder{
(PathTile.nearSolid(tile) || PathTile.solid(tile) ? 3 : 0),
costNaval = (team, tile) ->
(PathTile.solid(tile) || !PathTile.liquid(tile) ? impassable : 1) +
//impassable same-team neutral block, or non-liquid
((PathTile.solid(tile) && ((PathTile.team(tile) == team && !PathTile.teamPassable(tile)) || PathTile.team(tile) == 0)) || !PathTile.liquid(tile) ? impassable : 1) +
//impassable synthetic enemy block
((PathTile.team(tile) != team && PathTile.team(tile) != 0) && PathTile.solid(tile) ? wallImpassableCap : 0) +
(PathTile.nearGround(tile) || PathTile.nearSolid(tile) ? 6 : 0);
public static boolean showDebug = false;

View File

@@ -58,7 +58,8 @@ public class Pathfinder implements Runnable{
//water
(team, tile) ->
(PathTile.solid(tile) || !PathTile.liquid(tile) ? 6000 : 1) +
(!PathTile.liquid(tile) ? 6000 : 1) +
PathTile.health(tile) * 5 +
(PathTile.nearGround(tile) || PathTile.nearSolid(tile) ? 14 : 0) +
(PathTile.deep(tile) ? 0 : 1) +
(PathTile.damages(tile) ? 35 : 0)
@@ -527,7 +528,9 @@ public class Pathfinder implements Runnable{
}
protected boolean passable(int pos){
return cost.getCost(team.id, pathfinder.tiles[pos]) != impassable;
int amount = cost.getCost(team.id, pathfinder.tiles[pos]);
//edge case: naval reports costs of 6000+ for non-liquids, even though they are not technically passable
return amount != impassable && !(cost == costTypes.get(costNaval) && amount >= 6000);
}
/** Gets targets to pathfind towards. This must run on the main thread. */