claim threefold draw during opponent turn

This commit is contained in:
Thibault Duplessis 2014-04-28 11:41:09 +02:00
parent 5fcf8cbd8a
commit 0235a90c35
2 changed files with 2 additions and 5 deletions

View file

@ -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().&nbsp; @trans.threefoldRepetition().&nbsp;
<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>

View file

@ -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)
} }