Adv 2.0 post-L5 audit cleanup: drop redundant dual-writes + refresh stale comments

Audit confirmed saveAdvCharacter's fan-out (upsertAllPlayerMetaFromAdvChar)
covers all 13 migrated subsystems, so the per-call-site upsertPlayerMetaXxx
calls retained "as defense" through the L4-L5 migration are redundant
post-L5h. Removed 16 such call sites across arena (2), scheduler (4),
hospital (1), consumables (2), rival (1), housing (11), and reordered
masterwork to drop a now-pointless explicit upsert before the load+save.

Refreshed nine stale doc comments referencing the legacy
adventure_characters table or "soak window / fallback" language that no
longer applies after the L5 close-out (commit 596b2b7). No behavior
change; go vet + go test ./... pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-05-09 13:01:00 -07:00
parent c0f03a41b5
commit 5d98e5684a
11 changed files with 27 additions and 95 deletions

View File

@@ -497,11 +497,11 @@ func dndHPSnapshot(userID id.UserID) (cur, max int) {
return c.HPCurrent, c.HPMax
}
// markAdventureDead flips the legacy adventure_characters.alive flag and
// starts the 6h respawn timer for a player who went down in a D&D-layer
// combat. Without this, hp_current persists as 0 but the legacy alive
// flag stays true — the "zombie" state where !hospital says "you're
// alive!" while the sheet shows 0/33. Idempotent: bails if already dead.
// markAdventureDead flips Alive=false in player_meta (via saveAdvCharacter
// fan-out) and starts the 6h respawn timer for a player who went down in a
// D&D-layer combat. Without this, hp_current persists as 0 but Alive stays
// true — the "zombie" state where !hospital says "you're alive!" while the
// sheet shows 0/33. Idempotent: bails if already dead.
//
// source is "zone" / "expedition" / "patrol"; location is human-readable
// (e.g. "Forest of Shadows") and surfaces in the daily report and