Idle reaper: credit the closing day, not the new day

midnightReset runs at 00:00 UTC closing out yesterday, but gated idle
shame on HasActedToday(), which compares LastActionDate to today (the
new day). DnD-side players credit the day via LastActionDate only, so
anyone who played yesterday and extracted before midnight read as idle
and had their streak halved. Credit activity on the closing day
(LastActionDate==yesterday) directly, matching the streak-bump branch.

(cherry picked from commit f6cb4889e7e6bfacce41ea40853456b08d6857a9)
This commit is contained in:
prosolis
2026-05-20 19:23:46 -07:00
parent 01d2329993
commit bcd4a873a5

View File

@@ -407,7 +407,16 @@ func (p *AdventurePlugin) midnightReset() error {
dmsSent := 0 dmsSent := 0
for _, char := range chars { for _, char := range chars {
if !char.HasActedToday() { // This runs at 00:00 of the new UTC day, closing out the day that just
// ended (= yesterday). HasActedToday() compares LastActionDate against
// time.Now()'s date (the *new* day), so DnD-side players who credited
// the closing day via LastActionDate=yesterday would read as idle and
// get their streak halved. Credit activity on the closing day directly:
// legacy counters are still non-zero here (reset happens further below),
// and LastActionDate==yesterday means they played the day we're closing.
acted := char.CombatActionsUsed > 0 || char.HarvestActionsUsed > 0 ||
char.LastActionDate == today || char.LastActionDate == yesterday
if !acted {
// If the player died today or yesterday, they couldn't act — no shame, // If the player died today or yesterday, they couldn't act — no shame,
// no streak reset. This covers both currently-dead players and players // no streak reset. This covers both currently-dead players and players
// who were just revived at midnight (Alive already flipped to true by // who were just revived at midnight (Alive already flipped to true by