|
|
|
@ -301,8 +301,6 @@ private static final int cellGap = 1;
@@ -301,8 +301,6 @@ private static final int cellGap = 1;
|
|
|
|
|
} |
|
|
|
|
public static void pathfind(AbstractCharacter character, Vector3fImmutable goal){ |
|
|
|
|
try { |
|
|
|
|
if(character.isMoving()) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if(character.region == null && Regions.getRegionAtLocation(goal) != null) {//mover not inside a building
|
|
|
|
|
Building building = BuildingManager.getBuildingAtLocation(goal); |
|
|
|
@ -395,10 +393,14 @@ private static final int cellGap = 1;
@@ -395,10 +393,14 @@ private static final int cellGap = 1;
|
|
|
|
|
if (path.contains(cheapCorner)) { |
|
|
|
|
continue; |
|
|
|
|
}else { |
|
|
|
|
path.add(cheapCorner); |
|
|
|
|
current = cheapCorner; |
|
|
|
|
continue; |
|
|
|
|
path.add(cheapCorner); |
|
|
|
|
current = cheapCorner; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (path.contains(point)) |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (path.contains(point)) |
|
|
|
@ -406,8 +408,9 @@ private static final int cellGap = 1;
@@ -406,8 +408,9 @@ private static final int cellGap = 1;
|
|
|
|
|
|
|
|
|
|
Regions region = Regions.getRegionAtLocation(point); |
|
|
|
|
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; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (pointIsBlocked(point)) { |
|
|
|
|