Undo penalty deducted from pre-move score instead of post-move score #12
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?
File
solitaire_core/src/game_state.rslines 207–211, 405–411Description
push_snapshot()savesself.scorebefore the move is applied (line 210). On undo, the restored score issnapshot.score + scoring_undo()— i.e.,pre_move_score - 15.Example: player has 20 points, moves a card to foundation (+10 → 30), then undoes. Snapshot holds 20. Undo produces
max(0, 20 - 15) = 5. Correct result ismax(0, 30 - 15) = 15. The player loses 10 extra points on every undo that preceded a scoring move.Correct Windows XP Klondike scoring deducts -15 from the current post-move score, not the pre-move snapshot.
Fix
Apply the undo penalty to the current score at undo time rather than restoring the snapshot score and applying the penalty to that.