Skip to content

Commit

Permalink
can't give more than 2h
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Apr 2, 2015
1 parent b3422de commit 6ce5eb1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/chess
Submodule chess updated from 153425 to a31a43
3 changes: 2 additions & 1 deletion modules/game/src/main/Game.scala
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ case class Game(
!player(color).isProposingTakeback &&
!opponent(color).isProposingTakeback

def moretimeable = playable && nonMandatory && hasClock
def moretimeable(color: Color) =
playable && nonMandatory && clock.??(_ moretimeable color)

def abortable = status == Status.Started && playedTurns < 2 && nonMandatory

Expand Down
2 changes: 1 addition & 1 deletion modules/round/src/main/Round.scala
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private[round] final class Round(
case TakebackNo(playerRef) => handle(playerRef)(takebacker.no)

case Moretime(playerRef) => handle(playerRef) { pov =>
pov.game.clock.ifTrue(pov.game.moretimeable) ?? { clock =>
pov.game.clock.ifTrue(pov.game moretimeable !pov.color) ?? { clock =>
val newClock = clock.giveTime(!pov.color, moretimeDuration.toSeconds)
val progress = (pov.game withClock newClock) + Event.Clock(newClock)
messenger.system(pov.game, (_.untranslated(
Expand Down

0 comments on commit 6ce5eb1

Please sign in to comment.