From 016919675a7a9b2216633b2288e2cd1a957753d7 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 6 Nov 2023 09:54:34 -0500 Subject: [PATCH] Filter ineligible meshes --- src/engine/db/handlers/dbBuildingHandler.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/engine/db/handlers/dbBuildingHandler.java b/src/engine/db/handlers/dbBuildingHandler.java index 3c9cc940..39f9032b 100644 --- a/src/engine/db/handlers/dbBuildingHandler.java +++ b/src/engine/db/handlers/dbBuildingHandler.java @@ -566,13 +566,16 @@ public class dbBuildingHandler extends dbHandlerBase { String[] vertStrings = rs.getString("vertices").split(";"); ArrayList vertArrayList = new ArrayList<>(); - try { - for (int i = 0; i < vertStrings.length; i += 2) - vertArrayList.add(new Vector2f(Float.parseFloat(vertStrings[i]), Float.parseFloat(vertStrings[1 + 1]))); - } catch (Exception e) { - Logger.error("propID: " + propID); + // Filter things that couldn't be wrapped + + if (vertStrings.length < 3) { + Logger.error("Prop : " + propID + " has less than 3 vertices."); + continue; } + for (int i = 0; i < vertStrings.length; i += 2) + vertArrayList.add(new Vector2f(Float.parseFloat(vertStrings[i]), Float.parseFloat(vertStrings[1 + 1]))); + ArrayList> meshList; if (BuildingManager._hull_data.get(propID) == null) {