mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 15:38:59 +00:00
reset lastDrop to zero when day end
This commit is contained in:
parent
b0ebeb8c2c
commit
607336f56e
1 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue