mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 10:12:21 +00:00
sort eligibleEquipment before choosing random item from Enchaned Armoire - possible partial fix for https://github.com/HabitRPG/habitrpg/issues/5376#issuecomment-111799217
This commit is contained in:
parent
a44d760b8f
commit
6eac1174a2
1 changed files with 1 additions and 0 deletions
|
|
@ -882,6 +882,7 @@ api.wrap = (user, main=true) ->
|
|||
# the same seed would give one of the first five foods only.
|
||||
eligibleEquipment = _.filter(content.gear.flat, ((i)->i.klass is 'armoire' and !user.items.gear.owned[i.key]))
|
||||
if !_.isEmpty(eligibleEquipment) and (armoireResult < .6 or !user.flags.armoireOpened)
|
||||
eligibleEquipment.sort() # https://github.com/HabitRPG/habitrpg/issues/5376#issuecomment-111799217
|
||||
drop = user.fns.randomVal(eligibleEquipment)
|
||||
user.items.gear.owned[drop.key] = true
|
||||
user.flags.armoireOpened = true
|
||||
|
|
|
|||
Loading…
Reference in a new issue