Pathfinding tweak / Doors now update pathfinding
This commit is contained in:
@@ -39,6 +39,10 @@ public class Pathfinder{
|
||||
});
|
||||
}
|
||||
|
||||
public void updateSolid(Tile tile){
|
||||
update(tile, tile.getTeam());
|
||||
}
|
||||
|
||||
public void update(){
|
||||
if(Net.client() || paths == null) return;
|
||||
|
||||
@@ -94,6 +98,10 @@ public class Pathfinder{
|
||||
if(paths != null && paths[team.ordinal()] != null && paths[team.ordinal()].weights != null){
|
||||
PathData path = paths[team.ordinal()];
|
||||
|
||||
if(!path.frontier.isEmpty()){
|
||||
return;
|
||||
}
|
||||
|
||||
//impassable tiles have a weight of float.max
|
||||
if(!passable(tile, team)){
|
||||
path.weights[tile.x][tile.y] = Float.MAX_VALUE;
|
||||
|
||||
Reference in New Issue
Block a user