Browse Source

shape

hull4
FatBoy-DOTC 12 months ago
parent
commit
9615f85f0d
  1. 16
      src/engine/gameManager/ZoneManager.java
  2. 3
      src/engine/server/world/WorldServer.java

16
src/engine/gameManager/ZoneManager.java

@ -14,6 +14,7 @@ import engine.math.Bounds; @@ -14,6 +14,7 @@ import engine.math.Bounds;
import engine.math.Vector2f;
import engine.math.Vector3f;
import engine.math.Vector3fImmutable;
import engine.mobileAI.utilities.PathingUtilities;
import engine.objects.Building;
import engine.objects.City;
import engine.objects.Zone;
@ -21,6 +22,7 @@ import engine.objects.ZoneTemplate; @@ -21,6 +22,7 @@ import engine.objects.ZoneTemplate;
import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger;
import java.awt.geom.Path2D;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
@ -433,4 +435,18 @@ public enum ZoneManager { @@ -433,4 +435,18 @@ public enum ZoneManager {
return localAltitude < zone.sea_level;
}
public static void LinkNavNodes(){
for(Zone zone : getAllZones()){
for(PathingUtilities.Node node : zone.navNodes){
for(PathingUtilities.Node potentialNeighbor : zone.navNodes){
for (Path2D.Float obstacle : zone.navObstacles) {
if (!node.equals(potentialNeighbor) && !obstacle.intersects(node.location.x, node.location.y, potentialNeighbor.location.x, potentialNeighbor.location.y)){
node.neighbors.add(potentialNeighbor);
}
}
}
}
}
}
}

3
src/engine/server/world/WorldServer.java

@ -437,6 +437,9 @@ public class WorldServer { @@ -437,6 +437,9 @@ public class WorldServer {
DbManager.NPCQueries.GET_ALL_NPCS();
DbManager.MobQueries.GET_ALL_MOBS();
Logger.info("Generating Neighbors for NavNodes");
ZoneManager.LinkNavNodes();
Logger.info("time to load World Objects: " + (System.currentTimeMillis() - start) + " ms");
// Configure realms for serialization

Loading…
Cancel
Save