|
|
|
@ -301,6 +301,8 @@ private static final int cellGap = 1;
@@ -301,6 +301,8 @@ 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); |
|
|
|
@ -393,14 +395,10 @@ private static final int cellGap = 1;
@@ -393,14 +395,10 @@ 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)) |
|
|
|
@ -408,9 +406,8 @@ private static final int cellGap = 1;
@@ -408,9 +406,8 @@ private static final int cellGap = 1;
|
|
|
|
|
|
|
|
|
|
Regions region = Regions.getRegionAtLocation(point); |
|
|
|
|
if(region != null) { |
|
|
|
|
path.add(new Vector3fImmutable(region.center.x,region.center.y,region.center.z)); //only use center points when travelling through regions
|
|
|
|
|
path.add(new Vector3fImmutable(region.center)); //only use center points when travelling through regions
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (pointIsBlocked(point)) { |
|
|
|
|