[Medium] [Bug] Cancelling pact ritual doesn't refund mana — permanent resource loss #370
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?
Severity: Medium
File:
src/lib/game/stores/prestigeStore.ts(lines 125-145 startPactRitual, 147-151 cancelPactRitual)Description:
startPactRitualdeductsguardian.pactCostraw mana upfront (line 136:manaStore.spendRawMana(guardian.pactCost)). However, if the player cancels the ritual viacancelPactRitual, the mana is not refunded — the function only resetspactRitualFloorandpactRitualProgressto null/0.Impact: Cancelling a pact ritual permanently costs the player the full pact mana with no refund. This is unusual for a cancelable action and could be an unfair penalty, especially if cancelled by accident.
Fix needed: Refund the
guardian.pactCostmana incancelPactRitualwhen the ritual is cancelled.Fixed: cancelPactRitual now refunds guardian.pactCost raw mana via useManaStore.setState when a ritual is cancelled.