Fixed pathfinding through liquids / Switched overlay render layer
This commit is contained in:
@@ -155,7 +155,7 @@ public class Pathfinder{
|
|||||||
int dx = tile.x + point.x, dy = tile.y + point.y;
|
int dx = tile.x + point.x, dy = tile.y + point.y;
|
||||||
Tile other = world.tile(dx, dy);
|
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)){
|
&& passable(other, team)){
|
||||||
path.frontier.addFirst(world.tile(dx, dy));
|
path.frontier.addFirst(world.tile(dx, dy));
|
||||||
path.weights[dx][dy] = cost + other.cost;
|
path.weights[dx][dy] = cost + other.cost;
|
||||||
|
|||||||
@@ -247,15 +247,15 @@ public class Renderer extends RendererModule{
|
|||||||
|
|
||||||
overlays.drawBottom();
|
overlays.drawBottom();
|
||||||
drawAndInterpolate(playerGroup, p -> true, Player::drawBuildRequests);
|
drawAndInterpolate(playerGroup, p -> true, Player::drawBuildRequests);
|
||||||
overlays.drawTop();
|
|
||||||
|
|
||||||
Shaders.shield.color.set(Palette.accent);
|
Shaders.shield.color.set(Palette.accent);
|
||||||
|
|
||||||
Graphics.beginShaders(Shaders.shield);
|
Graphics.beginShaders(Shaders.shield);
|
||||||
EntityDraw.draw(shieldGroup);
|
EntityDraw.draw(shieldGroup);
|
||||||
EntityDraw.drawWith(shieldGroup, shield -> true, shield -> ((ShieldEntity)shield).drawOver());
|
EntityDraw.drawWith(shieldGroup, shield -> true, shield -> ((ShieldEntity)shield).drawOver());
|
||||||
Graphics.endShaders();
|
Graphics.endShaders();
|
||||||
|
|
||||||
|
overlays.drawTop();
|
||||||
|
|
||||||
if(showFog){
|
if(showFog){
|
||||||
Graphics.surface();
|
Graphics.surface();
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Reference in New Issue
Block a user