From 6eac1174a2c2fb73808b8f5f8388e3c73b763520 Mon Sep 17 00:00:00 2001 From: Alys Date: Sat, 20 Jun 2015 20:22:27 +1000 Subject: [PATCH] sort eligibleEquipment before choosing random item from Enchaned Armoire - possible partial fix for https://github.com/HabitRPG/habitrpg/issues/5376#issuecomment-111799217 --- common/script/index.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/common/script/index.coffee b/common/script/index.coffee index cc055a0b8d..1b04cd98ac 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -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