fix: keep points spent when a player removes a profession upgrade - #55
Conversation
Free points were lifetime points minus the cost of held upgrades, so removing an upgrade silently gave its points back despite the "Points are not refunded!" warning. Player removals now record the cost as forfeited per character, which keeps it spent. Forfeits don't count towards the max-upgrades cap. Admin removeupgrade still refunds, and the admin refund command clears forfeits. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughCharacters now track forfeited profession points, and profession spending includes those points. Confirmed player upgrade removals record forfeits, while admin removals do not. Refunds clear forfeits, and the database loads and saves them. ChangesProfession Upgrade Forfeits
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Player removals retain spent profession points, while admin removals and refunds remain distinct. No actionable merge-blocking risk is established. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The normal removal and rebuy flow keeps points spent, but a confirmation can apply to a different active character, and later profession configuration changes can alter how a forfeiture is valued. The demonstrated effects are confined to a player’s characters; no cross-player access was established. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
A rabbit checks the point totals with care Comment |
Removing a profession upgrade gave its points back, so players could respec for free, even though the confirm prompt says "Points are not refunded!". The cause: free points were computed as lifetime points minus the cost of currently held upgrades.
Changes
RPCharactertracksforfeitedProfessionPointsper profession (lowercase id).getSpentPointsOnProfessionincludes them, so a removed upgrade's cost stays spent, and buying it again costs full price./profession confirm(the player's own removal) forfeits the points.getTotalSpentPoints, the max-upgrades cap. Removing an upgrade still frees a slot, just not the points.removeupgradestill refunds (for fixing mistakes), andrefundalso clears forfeits.forfeited-profession-pointsobject on each character. Old data loads with no forfeits.Tests
ProfessionUpgradeForfeitTest.mvn packagepasses.🤖 Generated with Claude Code
Summary by CodeRabbit