fix(ludo): prevent pawns on safe squares from being sent home
Two bugs caused pawns to teleport back to the yard without capture:
1. Triple-six penalty blindly sent the last-moved piece to pos=-1
regardless of whether it was resting on a safe square. Now the
penalty only applies if the piece is NOT on a safe square.
2. captureAt() checked if the DESTINATION was safe but didn't guard
against the victim's own position being safe. Added a per-piece
safety check so a pawn sitting on any safe square (star squares,
colored start squares) can never be captured under any circumstance.
Co-Authored-By:
Claude Opus 4.6 <noreply@anthropic.com>
Showing
Please register or sign in to comment