Skip to content

Conversation

@johndoknjas
Copy link
Contributor

@johndoknjas johndoknjas commented Mar 8, 2025

Closes #17088.

This works if the only possibility left for a draw at that point in the code is the claim by insufficient material - should be the case, but not 100% sure. Are there any cases where lichess just says "Draw" (besides what this PR fixes)?

return `${i18n.site.fiftyMovesWithoutProgress}${i18n.site.draw}`;
if (d.game.threefold) return `${i18n.site.threefoldRepetition}${i18n.site.draw}`;
if (insufficientMaterial(d.game.variant.key, d.game.fen))
return `${i18n.site.insufficientMaterial}${i18n.site.draw}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like we already have a reusable translation there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ornicar Updated to use it, but having 'Draw claimed' as well avoids confusion (since in the other cases the draw is automatic).

return `${i18n.site.insufficientMaterial}${i18n.site.draw}`;
if (d.game.drawOffers?.some(turn => turn >= d.game.turns)) return i18n.site.drawByMutualAgreement;
return i18n.site.draw;
return i18n.site.drawClaimedByInsufficientMaterial;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure the only way to reach this default case is through insufficient material claim?

@ornicar ornicar merged commit 3230cc1 into lichess-org:master Mar 9, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claimed draw when the opponent does not have mating material should be explained in the game outcome

2 participants