diff --git a/src/engine/db/handlers/dbItemBaseHandler.java b/src/engine/db/handlers/dbItemBaseHandler.java index 24ef36a0..bd247835 100644 --- a/src/engine/db/handlers/dbItemBaseHandler.java +++ b/src/engine/db/handlers/dbItemBaseHandler.java @@ -102,9 +102,34 @@ public void LOAD_ALL_ITEM_REQUIREMENTS(){ PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_item_requirements WHERE 'itemID' = ?")) { preparedStatement.setInt(1, itemBase.getUUID()); ResultSet rs = preparedStatement.executeQuery(); - //while(rs.next()) { - itemBase.LoadRequirements(rs.getString("racesRequired"), rs.getString("racesRestricted"), rs.getString("classesRequired"), rs.getString("classesRestricted"), rs.getString("discsRequired"), rs.getString("discsRestricted")); - //} + while(rs.next()) { + + String racesRequired = ""; + if(rs.getString("racesRequired") != null) + racesRequired = rs.getString("racesRequired"); + + String racesRestricted = ""; + if(rs.getString("racesRestricted") != null) + racesRestricted = rs.getString("racesRestricted"); + + String classesRequired = ""; + if(rs.getString("classesRequired") != null) + classesRequired = rs.getString("classesRequired"); + + String classesRestricted = ""; + if(rs.getString("classesRestricted") != null) + classesRestricted = rs.getString("classesRestricted"); + + String discsRequired = ""; + if(rs.getString("discsRequired") != null) + discsRequired = rs.getString("discsRequired"); + + String discsRestricted = ""; + if(rs.getString("discsRestricted") != null) + discsRestricted = rs.getString("discsRestricted"); + + itemBase.LoadRequirements(racesRequired,racesRestricted,classesRequired, classesRestricted, discsRequired, discsRestricted); + } } catch (SQLException e) { Logger.error("No Entry In static_item_requirements for item UUID: " + itemBase.getUUID()); }