|
|
@ -301,8 +301,6 @@ private static final int cellGap = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
public static void pathfind(AbstractCharacter character, Vector3fImmutable goal){ |
|
|
|
public static void pathfind(AbstractCharacter character, Vector3fImmutable goal){ |
|
|
|
try { |
|
|
|
try { |
|
|
|
if(character.isMoving()) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(character.region == null && Regions.getRegionAtLocation(goal) != null) {//mover not inside a building
|
|
|
|
if(character.region == null && Regions.getRegionAtLocation(goal) != null) {//mover not inside a building
|
|
|
|
Building building = BuildingManager.getBuildingAtLocation(goal); |
|
|
|
Building building = BuildingManager.getBuildingAtLocation(goal); |
|
|
@ -399,6 +397,10 @@ private static final int cellGap = 1; |
|
|
|
current = cheapCorner; |
|
|
|
current = cheapCorner; |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (path.contains(point)) |
|
|
|
|
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (path.contains(point)) |
|
|
|
if (path.contains(point)) |
|
|
@ -406,8 +408,9 @@ private static final int cellGap = 1; |
|
|
|
|
|
|
|
|
|
|
|
Regions region = Regions.getRegionAtLocation(point); |
|
|
|
Regions region = Regions.getRegionAtLocation(point); |
|
|
|
if(region != null) { |
|
|
|
if(region != null) { |
|
|
|
path.add(new Vector3fImmutable(region.center)); //only use center points when travelling through regions
|
|
|
|
path.add(new Vector3fImmutable(region.center.x,region.center.y,region.center.z)); //only use center points when travelling through regions
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (pointIsBlocked(point)) { |
|
|
|
if (pointIsBlocked(point)) { |
|
|
|