Browse Source

Can roll list refactored

combat-2
MagicBot 8 months ago
parent
commit
8e43f17da0
  1. 4
      src/engine/db/handlers/dbItemHandler.java
  2. 2
      src/engine/objects/NPC.java

4
src/engine/db/handlers/dbItemHandler.java

@ -321,12 +321,12 @@ public class dbItemHandler extends dbHandlerBase { @@ -321,12 +321,12 @@ public class dbItemHandler extends dbHandlerBase {
return worked;
}
public HashSet<Integer> GET_ITEMS_FOR_VENDOR(final int vendorID) {
public HashSet<Integer> GET_VENDOR_CAN_ROLL_LIST(final int vendorID) {
HashSet<Integer> itemSet = new HashSet<>();
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT ID FROM static_itembase WHERE vendorType = ?")) {
PreparedStatement preparedStatement = connection.prepareStatement("SELECT ID FROM static_vendor_items WHERE vendorType = ?")) {
preparedStatement.setInt(1, vendorID);

2
src/engine/objects/NPC.java

@ -1039,7 +1039,7 @@ public class NPC extends AbstractCharacter { @@ -1039,7 +1039,7 @@ public class NPC extends AbstractCharacter {
public HashSet<Integer> getCanRoll() {
if (this.canRoll == null)
this.canRoll = DbManager.ItemQueries.GET_ITEMS_FOR_VENDOR(this.vendorID);
this.canRoll = DbManager.ItemQueries.GET_VENDOR_CAN_ROLL_LIST(this.vendorID);
HashSet<Integer> fullItemList = this.canRoll;
HashSet<Integer> filteredItemList = new HashSet<>();

Loading…
Cancel
Save