Fixed pathfinding through liquids / Switched overlay render layer

This commit is contained in:
Anuken
2018-10-18 00:02:12 -04:00
parent 6ecdef02ab
commit e3001b614e
2 changed files with 3 additions and 3 deletions
@@ -155,7 +155,7 @@ public class Pathfinder{
int dx = tile.x + point.x, dy = tile.y + point.y;
Tile other = world.tile(dx, dy);
if(other != null && (path.weights[dx][dy] == Float.MAX_VALUE || path.searches[dx][dy] < path.search)
if(other != null && (path.weights[dx][dy] > cost + other.cost || path.searches[dx][dy] < path.search)
&& passable(other, team)){
path.frontier.addFirst(world.tile(dx, dy));
path.weights[dx][dy] = cost + other.cost;