Clarified comments in user model

This commit is contained in:
Blade Barringer
2015-01-02 15:26:16 -06:00
parent 45c045e853
commit 19fc403b2f
+5 -3
View File
@@ -430,6 +430,7 @@ UserSchema.pre('save', function(next) {
'Anonymous';
}
// Determines if Beast Master should be awarded
var petCount = shared.countPets(_.reduce(this.items.pets,function(m,v){
//HOTFIX - Remove when solution is found, the first argument passed to reduce is a function
if(_.isFunction(v)) return m;
@@ -438,8 +439,9 @@ UserSchema.pre('save', function(next) {
if (petCount >= 90 || this.achievements.beastMasterCount > 0) {
this.achievements.beastMaster = true
}
// mountmaster stuff starts
var mountCount = shared.countMounts(_.reduce(this.items.mounts,function(m,v){
// Determines if Mount Master should be awarded
var mountCount = shared.countMounts(_.reduce(this.items.mounts,function(m,v){
//HOTFIX - Remove when solution is found, the first argument passed to reduce is a function
if(_.isFunction(v)) return m;
return m+(v?1:0)},0), this.items.mounts);
@@ -447,7 +449,7 @@ UserSchema.pre('save', function(next) {
if (mountCount >= 90 || this.achievements.mountMasterCount > 0) {
this.achievements.mountMaster = true
}
// mountmaster stuff ends
// EXAMPLE CODE for allowing all existing and new players to be
// automatically granted an item during a certain time period: