From 19fc403b2fbb994fed671110f8b9da2e07b8df98 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 2 Jan 2015 15:26:16 -0600 Subject: [PATCH] Clarified comments in user model --- src/models/user.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/models/user.js b/src/models/user.js index 3f7b0b3d3e..91d1740ed8 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -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: