mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 17:02:42 +00:00
Fix streak grace period, UNO earnings, hospital UX, wordle/lottery atomicity
- Streak grace now checks LastDeathDate instead of LastActionDate (was suppressing streak updates for all active players) - UNO single-player earnings use net payout (minus wager) not gross - Hospital sends error message on save failure instead of silent no-op - Wordle total_earned update moved into stats transaction - Lottery ticket inserts + community pot add wrapped in single transaction with euro refund on failure - Lottery fixed-tier ticket prize updated with actual prorated amount - Added last_death_date column to adventure_characters Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -314,14 +314,10 @@ func (p *AdventurePlugin) midnightReset() error {
|
||||
}
|
||||
|
||||
if !char.ActionTakenToday {
|
||||
// If the player was recently dead (revived today but couldn't act
|
||||
// in time), preserve their streak instead of resetting it.
|
||||
// We detect this by checking if LastActionDate was yesterday —
|
||||
// they were active, then died, and couldn't act on revival day.
|
||||
recentlyDead := char.LastActionDate == today ||
|
||||
char.LastActionDate == time.Now().UTC().Add(-24*time.Hour).Format("2006-01-02")
|
||||
if recentlyDead {
|
||||
// Grace period — don't shame, don't reset
|
||||
// If the player died today (or yesterday — covering late-night deaths
|
||||
// that span midnight), grant a grace period: no shame, no streak reset.
|
||||
if char.LastDeathDate == today ||
|
||||
char.LastDeathDate == time.Now().UTC().Add(-24*time.Hour).Format("2006-01-02") {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user