From a89ef25e230ca88d2928bb90ee04bf8bb781b93b Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Wed, 8 Jan 2014 19:35:54 -0600 Subject: [PATCH] Rebirth fix: flip owned items to explicit false instead of wiping them out, so limited edition gear can be repurchased --- dist/habitrpg-shared.js | 10 +++++++--- script/index.coffee | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index 291435a157..607db90635 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -11511,9 +11511,13 @@ var process=require("__browserify_process");(function() { } }); } - gear.owned = { - weapon_warrior_0: true - }; + _.each(gear.owned, function(v, k) { + if (gear.owned[k]) { + gear.owned[k] = false; + return true; + } + }); + gear.owned.weapon_warrior_0 = true; if (typeof user.markModified === "function") { user.markModified('items.gear.owned'); } diff --git a/script/index.coffee b/script/index.coffee index 40d42094d7..6c315a942f 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -441,8 +441,9 @@ 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 - gear.owned = {weapon_warrior_0:true} + # 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 + gear.owned.weapon_warrior_0 = true user.markModified? 'items.gear.owned' user.preferences.costume = false # Remove unlocked features