From 25b508a101d0a5c0a6d9cae6c1bf4da8fb184d38 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 6 Nov 2023 12:06:45 -0500 Subject: [PATCH] Enhanced sanity checks. --- src/engine/gameManager/BuildingManager.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index 4b2c4037..99672379 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -966,8 +966,10 @@ public enum BuildingManager { public static void bakeNavMesh(Building building) { - if (building.parentZone == null) + if (building.parentZone == null) { Logger.error("Attempt to bake navmesh with no parent: " + building.getObjectUUID()); + return; + } // Build up navmesh by stencil of the // convex hull meshes that comprise the prop. @@ -975,6 +977,11 @@ public enum BuildingManager { ArrayList> convexHullList; convexHullList = _hull_data.get(building.meshUUID); + if (convexHullList == null) { + Logger.error("Attempt to bake navmesh with no meshes: " + building.getObjectUUID()); + return; + } + for (ArrayList meshEntry : convexHullList) { Path2D.Float stencilPath = new Path2D.Float();