claim threefold draw during opponent turn
This commit is contained in:
parent
5fcf8cbd8a
commit
0235a90c35
|
@ -33,7 +33,7 @@
|
||||||
<a class="force_draw socket-link" data-msg="draw-force">@trans.forceDraw()</a>
|
<a class="force_draw socket-link" data-msg="draw-force">@trans.forceDraw()</a>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@if(game.turnOf(player) && game.toChessHistory.threefoldRepetition) {
|
@if(game.toChessHistory.threefoldRepetition) {
|
||||||
<div id="claim_draw_zone">
|
<div id="claim_draw_zone">
|
||||||
@trans.threefoldRepetition().
|
@trans.threefoldRepetition().
|
||||||
<a class="lichess_claim_draw socket-link" data-msg="draw-claim">@trans.claimADraw()</a>
|
<a class="lichess_claim_draw socket-link" data-msg="draw-claim">@trans.claimADraw()</a>
|
||||||
|
|
|
@ -35,10 +35,7 @@ private[round] final class Drawer(messenger: Messenger, finisher: Finisher) {
|
||||||
}
|
}
|
||||||
|
|
||||||
def claim(pov: Pov): Fu[Events] =
|
def claim(pov: Pov): Fu[Events] =
|
||||||
(pov.game.playable &&
|
(pov.game.playable && pov.game.toChessHistory.threefoldRepetition) ?? finisher(pov.game, _.Draw)
|
||||||
pov.game.player.color == pov.color &&
|
|
||||||
pov.game.toChessHistory.threefoldRepetition
|
|
||||||
) ?? finisher(pov.game, _.Draw)
|
|
||||||
|
|
||||||
def force(game: Game): Fu[Events] = finisher(game, _.Draw, None, None)
|
def force(game: Game): Fu[Events] = finisher(game, _.Draw, None, None)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue