From 57e7fc93d7f8d32fba22f3c6685b153a734149a8 Mon Sep 17 00:00:00 2001 From: Alys Date: Wed, 12 Aug 2015 16:01:53 +1000 Subject: [PATCH] prevent Orb of Rebirth removing free equipment (gear that has zero gold cost) - partial fix for https://github.com/HabitRPG/habitrpg/issues/5750 --- common/script/index.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/script/index.coffee b/common/script/index.coffee index 4cdde33b0b..7eeea96cf2 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -567,8 +567,8 @@ api.wrap = (user, main=true) -> gear[type].shield = 'shield_base_0' if user.items.currentPet then user.ops.equip({params:{type: 'pet', key: user.items.currentPet}}) if user.items.currentMount then user.ops.equip({params:{type: 'mount', key: user.items.currentMount}}) - # Strip owned gear down to the training sword, but preserve purchase history so user can re-purchase limited edition equipment - _.each gear.owned, (v, k) -> if gear.owned[k] then gear.owned[k] = false; true + # Strip owned gear down to the training sword and free items (zero gold value), but preserve purchase history so user can re-purchase limited edition equipment + _.each gear.owned, (v, k) -> if gear.owned[k] and content.gear.flat[k].value then gear.owned[k] = false; true gear.owned.weapon_warrior_0 = true user.markModified? 'items.gear.owned' user.preferences.costume = false