mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-29 15:35:15 -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
|
unless itemModel and heroClass in itemModel.classes
|
||||||
console.log 'Unequipping', itemModel.get('heroClass'), 'item', itemModel.get('name'), 'from slot due to class restrictions.'
|
console.log 'Unequipping', itemModel.get('heroClass'), 'item', itemModel.get('name'), 'from slot due to class restrictions.'
|
||||||
@unequipItemFromSlot @$el.find(".item-slot[data-slot='#{slot}']")
|
@unequipItemFromSlot @$el.find(".item-slot[data-slot='#{slot}']")
|
||||||
|
delete equipment[slot]
|
||||||
for slot, item of restrictedGear
|
for slot, item of restrictedGear
|
||||||
equipped = equipment[slot]
|
equipped = equipment[slot]
|
||||||
if equipped and equipped is gear[restrictedGear[slot]]
|
if equipped and equipped is gear[restrictedGear[slot]]
|
||||||
console.log 'Unequipping restricted item', restrictedGear[slot], 'for', slot, 'before level', @options.levelID
|
console.log 'Unequipping restricted item', restrictedGear[slot], 'for', slot, 'before level', @options.levelID
|
||||||
@unequipItemFromSlot @$el.find(".item-slot[data-slot='#{slot}']")
|
@unequipItemFromSlot @$el.find(".item-slot[data-slot='#{slot}']")
|
||||||
|
delete equipment[slot]
|
||||||
if heroClass is 'Warrior'
|
if heroClass is 'Warrior'
|
||||||
# After they switch to a ranger or wizard, we stop being so finicky about gear.
|
# After they switch to a ranger or wizard, we stop being so finicky about gear.
|
||||||
for slot, item of requiredGear
|
for slot, item of requiredGear
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue