mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
Fixed bugs with unequipping restricted items not then requiring the proper item afterward.
This commit is contained in:
parent
cee017c7ec
commit
074d9f33c2
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue