Merge pull request #30 from HabitRPG/paglias/reeset-lastdrop

Reset lastDrop to zero when day ends
This commit is contained in:
Tyler Renelle
2013-10-24 12:05:38 -07:00
+5
View File
@@ -383,6 +383,11 @@ obj.cron = (user, options={}) ->
user.lastCron = now; paths['lastCron'] = true
# Reset the lastDrop count to zero
if user.items.lastDrop.count > 0
user.items.lastDrop.count = 0
paths['items.lastDrop'] = true
# User is resting at the inn. Used to be we un-checked each daily without performing calculation (see commits before fb29e35)
# but to prevent abusing the inn (http://goo.gl/GDb9x) we now do *not* calculate dailies, and simply set lastCron to today
return if user.flags.rest is true