Equipslot stored as string

This commit is contained in:
2024-03-29 13:23:56 -04:00
parent 0e431aa726
commit cfc36c0c27
2 changed files with 10 additions and 2 deletions
+4 -1
View File
@@ -92,7 +92,10 @@ public class dbItemHandler extends dbHandlerBase {
break;
}
preparedStatement.setByte(7, (byte) toAdd.equipSlot.ordinal());
if (toAdd.equipSlot.equals(Enum.EquipSlotType.NONE))
preparedStatement.setString(7, "");
else
preparedStatement.setString(7, toAdd.equipSlot.name());
String flagString = "";
+6 -1
View File
@@ -147,7 +147,12 @@ public class Item extends AbstractWorldObject {
this.canDestroy = true;
this.equipSlot = EquipSlotType.values()[rs.getByte("equipSlot")];
String equipString = rs.getString("equipSlot");
if (equipString.isEmpty())
this.equipSlot = EquipSlotType.NONE;
else
this.equipSlot = EquipSlotType.valueOf(equipString);
this.numberOfItems = rs.getInt("numberOfItems");