Browse Source

Filter ineligible meshes

hull4
MagicBot 1 year ago
parent
commit
016919675a
  1. 11
      src/engine/db/handlers/dbBuildingHandler.java

11
src/engine/db/handlers/dbBuildingHandler.java

@ -566,12 +566,15 @@ public class dbBuildingHandler extends dbHandlerBase { @@ -566,12 +566,15 @@ public class dbBuildingHandler extends dbHandlerBase {
String[] vertStrings = rs.getString("vertices").split(";");
ArrayList<Vector2f> vertArrayList = new ArrayList<>();
try {
// 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])));
} catch (Exception e) {
Logger.error("propID: " + propID);
}
ArrayList<ArrayList<Vector2f>> meshList;

Loading…
Cancel
Save