[Medium] [Bug] Spire Climbing: Guardian rooms not re-initialized when not cleared on ascent #300
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spec: docs/specs/spire-climbing-spec.md §4.7
Severity: Medium
Problem:
src/lib/game/stores/combat-descent-actions.ts:193-203—onEnterRoomDescend()only re-initializes guardian defensive state whendidReset === true. If the room was never cleared on ascent (!wasCleared), it returns early without re-initializing guardian state. This could lead to stale/missing shield/barrier values for guardian rooms that weren't cleared on ascent.File:
src/lib/game/stores/combat-descent-actions.ts:170-203Starting work on guardian room re-initialization bug. Investigating combat-descent-actions.ts:170-203.
Fix applied and pushed. Added guardian defensive state initialization for uncleared guardian rooms during descent in
onEnterRoomDescend().Root cause: When a room wasn't cleared on ascent (
!wasCleared), the function returned early without checking if it was a guardian room. This meant guardian shield/barrier values were never initialized for these rooms, leading to stale/missing defensive state.Fix: Before the early return in the
!wasClearedbranch, added a check: if the current room is a guardian room, initializeguardianShield,guardianShieldMax,guardianBarrier, andguardianBarrierMaxfrom the guardian definition. This mirrors the same initialization that happens in thedidResetbranch.Tests: 1069 passed (58 files), all pre-commit checks pass. File size: 276 lines (under 400 limit).