reset lastDrop to zero when day end

This commit is contained in:
Matteo Pagliazzi 2013-10-22 21:45:33 +02:00
parent b0ebeb8c2c
commit 607336f56e

View file

@ -371,6 +371,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