fix to special gear not showing up properly

This commit is contained in:
Tyler Renelle 2013-12-16 22:37:53 -07:00
parent 7e82e2f5e0
commit c2ace688b9
2 changed files with 4 additions and 8 deletions

View file

@ -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) {

View file

@ -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) ->