auto claim threefold after offering a draw (fixes #883)

pull/2486/head
Niklas Fiekas 2016-12-27 14:09:43 +01:00
parent 7c96e52bfa
commit 808ffbb038
1 changed files with 2 additions and 1 deletions

View File

@ -15,7 +15,8 @@ private[round] final class Drawer(
def autoThreefold(game: Game)(implicit proxy: GameProxy): Fu[Option[Pov]] = Pov(game).map { pov =>
import Pref.PrefZero
pov.player.userId ?? prefApi.getPref map { pref =>
if (game.playerHasOfferedDraw(pov.color)) fuccess(pov.some)
else pov.player.userId ?? prefApi.getPref map { pref =>
pref.autoThreefold == Pref.AutoThreefold.ALWAYS || {
pref.autoThreefold == Pref.AutoThreefold.TIME &&
game.clock ?? { _.remainingTime(pov.color) < 30 }