diff --git a/src/engine/db/handlers/dbItemHandler.java b/src/engine/db/handlers/dbItemHandler.java index e21f87da..117b3602 100644 --- a/src/engine/db/handlers/dbItemHandler.java +++ b/src/engine/db/handlers/dbItemHandler.java @@ -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 = ""; diff --git a/src/engine/objects/Item.java b/src/engine/objects/Item.java index dbe828d3..8b3c3e12 100644 --- a/src/engine/objects/Item.java +++ b/src/engine/objects/Item.java @@ -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");