This commit is contained in:
2023-10-27 23:16:08 -05:00
parent d57e5df356
commit e128f60519
3 changed files with 10 additions and 10 deletions
@@ -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;
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;
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)) {