From 074d9f33c2c0294f85d1fe2171e55f8ba52ae766 Mon Sep 17 00:00:00 2001 From: Nick Winter <livelily@gmail.com> Date: Fri, 21 Nov 2014 12:20:24 -0800 Subject: [PATCH] Fixed bugs with unequipping restricted items not then requiring the proper item afterward. --- app/views/game-menu/InventoryModal.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/game-menu/InventoryModal.coffee b/app/views/game-menu/InventoryModal.coffee index 618af9815..fae444711 100644 --- a/app/views/game-menu/InventoryModal.coffee +++ b/app/views/game-menu/InventoryModal.coffee @@ -378,11 +378,13 @@ module.exports = class InventoryModal extends ModalView unless itemModel and heroClass in itemModel.classes console.log 'Unequipping', itemModel.get('heroClass'), 'item', itemModel.get('name'), 'from slot due to class restrictions.' @unequipItemFromSlot @$el.find(".item-slot[data-slot='#{slot}']") + delete equipment[slot] for slot, item of restrictedGear equipped = equipment[slot] if equipped and equipped is gear[restrictedGear[slot]] console.log 'Unequipping restricted item', restrictedGear[slot], 'for', slot, 'before level', @options.levelID @unequipItemFromSlot @$el.find(".item-slot[data-slot='#{slot}']") + delete equipment[slot] if heroClass is 'Warrior' # After they switch to a ranger or wizard, we stop being so finicky about gear. for slot, item of requiredGear