mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-13 17:27:35 +07:00
Pathfinding cleanup
Some checks failed
Validate Gradle Wrapper / Validation (push) Successful in 48s
Tests / runPush (push) Failing after 42s
Some checks failed
Validate Gradle Wrapper / Validation (push) Successful in 48s
Tests / runPush (push) Failing after 42s
This commit is contained in:
@ -4,7 +4,6 @@ import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.util.*;
|
||||
import mindustry.*;
|
||||
import mindustry.ai.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
@ -127,7 +126,7 @@ public class AIController implements UnitController{
|
||||
if(tile == null) return;
|
||||
Tile targetTile = pathfinder.getTargetTile(tile, pathfinder.getField(unit.team, costType, pathTarget));
|
||||
|
||||
if(tile == targetTile || (costType == Pathfinder.costNaval && !targetTile.floor().isLiquid)) return;
|
||||
if(tile == targetTile || !unit.canPass(targetTile.x, targetTile.y)) return;
|
||||
|
||||
unit.movePref(vec.trns(unit.angleTo(targetTile.worldx(), targetTile.worldy()), prefSpeed()));
|
||||
}
|
||||
|
Reference in New Issue
Block a user