bonus code cleanup

This commit is contained in:
2023-10-27 20:03:15 -05:00
parent bf1182dd2c
commit 6cc6713650
6 changed files with 50 additions and 11 deletions
@@ -18,6 +18,7 @@ import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager;
import engine.gameManager.ChatManager;
import engine.gameManager.MovementManager;
import engine.gameManager.ZoneManager;
import engine.math.Bounds;
import engine.math.Vector3fImmutable;
import engine.mobileAI.Threads.MobAIThread;
@@ -432,20 +433,19 @@ private static final int cellGap = 4;
public static boolean pointIsBlocked(Vector3fImmutable point) {
//TODO figure out best way to decide if a walking point intersects a mesh collider from a building
Building building = BuildingManager.getBuildingAtLocation(point);
if(building == null)
return false;//no building at this location means nothing obstructing the walking path
if(!collidesWithBuilding(building,point))
return false;
if(Regions.getRegionAtLocation(point) != null)
return false;
return false;
Zone currentZone = ZoneManager.findSmallestZone(point);
if(currentZone == null)
return false;
else
return currentZone.navMesh.contains(point.x,point.z);
//return false;
}
private static boolean collidesWithBuilding(Building building, Vector3fImmutable end){