Fixed #4993
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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(){
|
||||
|
||||
Reference in New Issue
Block a user