diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index 230e1b42af..0ec361426a 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -10689,12 +10689,8 @@ var process=require("__browserify_process");(function() { } return true; }); - _.defaults(changes, _.transform(_.where(content.gear.flat, { - klass: 'special' - }), function(m, v) { - if ((typeof v.canOwn === "function" ? v.canOwn(user) : void 0) && !user.items.gear.owned[v.key]) { - return m.push(v); - } + changes = changes.concat(_.filter(content.gear.flat, function(v) { + return v.klass === 'special' && !user.items.gear.owned[v.key] && (typeof v.canOwn === "function" ? v.canOwn(user) : void 0); })); changes.push(content.potion); return _.sortBy(changes, function(item) { diff --git a/script/index.coffee b/script/index.coffee index 0f808e41e2..d10851d664 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -117,8 +117,8 @@ api.updateStore = (user) -> changes.push(found) if found true # Add special items (contrib gear, backer gear, etc) - _.defaults changes, _.transform _.where(content.gear.flat, {klass:'special'}), (m,v) -> - m.push v if v.canOwn?(user) && !user.items.gear.owned[v.key] + changes = changes.concat _.filter content.gear.flat, (v) -> + v.klass is 'special' and !user.items.gear.owned[v.key] and v.canOwn?(user) changes.push content.potion # Return sorted store (array) _.sortBy changes, (item) ->