Adventure: extend NPC encounter expiry to end of UTC day

NPC encounter pending interactions were using advDMResponseWindow
(the short DM-reply window), so a player who didn't get to their DMs
quickly would lose the encounter prompt. Bumped to "until midnight UTC"
so the encounter is available throughout the day the NPC arrived.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-04-28 22:36:36 -07:00
parent d93dc4faa4
commit 6eadb09c1e

View File

@@ -154,11 +154,12 @@ func (p *AdventurePlugin) npcFireEncounter(userID id.UserID, npc string) {
return
}
// Set pending interaction
// Set pending interaction — NPC encounters stay valid until end of UTC day
endOfDay := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.UTC).Add(24 * time.Hour)
p.pending.Store(string(userID), &advPendingInteraction{
Type: "npc_encounter",
Data: npc,
ExpiresAt: time.Now().Add(advDMResponseWindow),
ExpiresAt: endOfDay,
})
if err := p.SendDM(userID, prompt); err != nil {