mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-04 01:29:21 +00:00
pets: better fix than 64ac920 , and unsets beastmaster if wrongly set
This commit is contained in:
parent
64ac920ca7
commit
224cbe2277
1 changed files with 2 additions and 3 deletions
|
|
@ -263,9 +263,8 @@ UserSchema.pre('save', function(next) {
|
|||
'Anonymous';
|
||||
}
|
||||
|
||||
if(!this.achievements.beastMaster && _.size(this.items.pets) >= 90){
|
||||
this.achievements.beastMaster = true;
|
||||
}
|
||||
var petCount = _.reduce(this.items.pets,function(m,v){return m+(v ? 1 : 0);},0);
|
||||
this.achievements.beastMaster = petCount >= 90;
|
||||
|
||||
//our own version incrementer
|
||||
this._v++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue