This commit is contained in:
Anuken
2021-03-25 12:51:24 -04:00
parent d10123295c
commit 7924d9b9ef
2 changed files with 4 additions and 4 deletions

View File

@@ -108,7 +108,7 @@ public class Pathfinder implements Runnable{
/** Packs a tile into its internal representation. */
private int packTile(Tile tile){
boolean nearLiquid = false, nearSolid = false, nearGround = false;
boolean nearLiquid = false, nearSolid = false, nearGround = false, solid = tile.solid();
for(int i = 0; i < 4; i++){
Tile other = tile.nearby(i);
@@ -120,9 +120,9 @@ public class Pathfinder implements Runnable{
}
return PathTile.get(
tile.build == null || !tile.solid() || tile.block() instanceof CoreBlock ? 0 : Math.min((int)(tile.build.health / 40), 80),
tile.build == null || !solid || tile.block() instanceof CoreBlock ? 0 : Math.min((int)(tile.build.health / 40), 80),
tile.getTeamID(),
tile.solid(),
solid,
tile.floor().isLiquid,
tile.staticDarkness() >= 2 || (tile.floor().solid && tile.block() == Blocks.air),
nearLiquid,

View File

@@ -90,7 +90,7 @@ public class AIController implements UnitController{
if(tile == targetTile || (costType == Pathfinder.costNaval && !targetTile.floor().isLiquid)) return;
unit.moveAt(vec.trns(unit.angleTo(targetTile), unit.speed()));
unit.moveAt(vec.trns(unit.angleTo(targetTile.worldx(), targetTile.worldy()), unit.speed()));
}
protected void updateWeapons(){