From a8ccf0c67c9c83e5cfd57cecc60fdccd3d89a747 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 6 Nov 2023 00:25:25 -0500 Subject: [PATCH] Support for variable length vert fields --- src/engine/db/handlers/dbBuildingHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/db/handlers/dbBuildingHandler.java b/src/engine/db/handlers/dbBuildingHandler.java index 8569b0db..9360e380 100644 --- a/src/engine/db/handlers/dbBuildingHandler.java +++ b/src/engine/db/handlers/dbBuildingHandler.java @@ -566,8 +566,8 @@ public class dbBuildingHandler extends dbHandlerBase { String[] vertStrings = rs.getString("vertices").split(";"); ArrayList vertArrayList = new ArrayList<>(); - vertArrayList.add(new Vector2f(Float.parseFloat(vertStrings[0]), Float.parseFloat(vertStrings[1]))); - vertArrayList.add(new Vector2f(Float.parseFloat(vertStrings[2]), Float.parseFloat(vertStrings[3]))); + for (int i = 0; i < vertStrings.length; i += 2) + vertArrayList.add(new Vector2f(Float.parseFloat(vertStrings[i]), Float.parseFloat(vertStrings[1 + 1]))); ArrayList> meshList;