From 607336f56eaa29c8c95904815a8b4b60518c5d88 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Tue, 22 Oct 2013 21:45:33 +0200 Subject: [PATCH] reset lastDrop to zero when day end --- script/algos.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/algos.coffee b/script/algos.coffee index 7f5ecbe66e..b8081e6bdc 100644 --- a/script/algos.coffee +++ b/script/algos.coffee @@ -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