This commit is contained in:
2023-10-27 21:55:31 -05:00
parent c63c5e6896
commit f002de704b
4 changed files with 27 additions and 8 deletions
+9 -4
View File
@@ -33,6 +33,9 @@ import engine.net.client.msg.ApplyBuildingEffectMsg;
import engine.net.client.msg.UpdateObjectMsg;
import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger;
import java.awt.*;
import java.awt.geom.Area;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDateTime;
@@ -1533,11 +1536,13 @@ public class Building extends AbstractWorldObject {
}
public void updateNavMesh(){
int xPoint = (int)(this.loc.x - this.getBounds().getHalfExtents().x);
int zPoint = (int) (this.loc.z - this.getBounds().getHalfExtents().y);
int extentsX = (int) (this.getBounds().getHalfExtents().x * 2);
int extentsZ = (int) (this.getBounds().getHalfExtents().y * 2);
this.parentZone.navMesh.subtract( new Area(new Rectangle(xPoint, zPoint, extentsX, extentsZ)));//remove entire footprint of building from navMesh
for(Regions region : this.getBounds().getRegions())
this.parentZone.navMesh.add(region.getArea());
MeshBounds meshBounds = Bounds.meshBoundsCache.get(this.getMeshUUID());
if(meshBounds != null)
this.parentZone.navMesh.subtract(meshBounds.getArea(this.loc.x,this.loc.z));
}
}
-1
View File
@@ -189,7 +189,6 @@ public class Zone extends AbstractWorldObject {
}
public void createNavMesh(){
Vector3fImmutable location = this.loc;
int xPoint = (int)(this.absX - this.bounds.getHalfExtents().x);
int zPoint = (int) (this.absZ - this.bounds.getHalfExtents().y);
int extentsX = (int) (this.bounds.getHalfExtents().x * 2);