use helpers.countPets on server, fix client side pet count

This commit is contained in:
Matteo Pagliazzi
2013-11-20 18:48:48 +01:00
parent 6fc848270f
commit 4bedefbc57
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -267,7 +267,7 @@ UserSchema.pre('save', function(next) {
'Anonymous';
}
var petCount = _.reduce(this.items.pets,function(m,v){return m+(v ? 1 : 0);},0);
var petCount = helpers.countPets(_.reduce(this.items.pets,function(m,v){return m+(v?1:0)},0), this.items.pets);
this.achievements.beastMaster = petCount >= 90;
//our own version incrementer