From 253ca2344e8c0c4deee41986b7f82ffac715fd9e Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 5 Jan 2024 22:44:58 -0600 Subject: [PATCH] add Y axis of building to mesh height --- src/engine/db/handlers/dbBuildingHandler.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/engine/db/handlers/dbBuildingHandler.java b/src/engine/db/handlers/dbBuildingHandler.java index ce547033..e0162ab9 100644 --- a/src/engine/db/handlers/dbBuildingHandler.java +++ b/src/engine/db/handlers/dbBuildingHandler.java @@ -915,7 +915,21 @@ public class dbBuildingHandler extends dbHandlerBase { } catch (SQLException e) { Logger.error(e); } + try (Connection connection = DbManager.getConnection(); + PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_mesh_triangles`")) { + + ResultSet rs = preparedStatement.executeQuery(); + BuildingManager.mesh_heights = new HashMap<>(); + while (rs.next()) { + if(BuildingManager.mesh_heights.containsKey(rs.getInt("meshID")) == false){ + BuildingManager.mesh_heights.put(rs.getInt("meshID"),rs.getFloat("maxY")); + } + } + + } catch (SQLException e) { + Logger.error(e); + } } public void LOAD_MESH_BOUNDING_BOXES() {