[gnome-games] chess: Only allow draw for fifty move rule
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] chess: Only allow draw for fifty move rule
- Date: Tue, 25 Jan 2011 05:21:41 +0000 (UTC)
commit 8738308ab4fbc10be223ee2fc7c2bb9c680e8152
Author: Robert Ancell <robert ancell canonical com>
Date: Tue Jan 25 15:00:06 2011 +1000
chess: Only allow draw for fifty move rule
glchess/src/chess-game.vala | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/glchess/src/chess-game.vala b/glchess/src/chess-game.vala
index c3c1c1f..9e286d2 100644
--- a/glchess/src/chess-game.vala
+++ b/glchess/src/chess-game.vala
@@ -1041,9 +1041,10 @@ public class ChessGame
if (!is_started)
return false;
- // FIXME: Check if can
-
- stop (ChessResult.DRAW, ChessRule.FIFTY_MOVES);
+ if (move_stack.data.halfmove_clock >= 50)
+ stop (ChessResult.DRAW, ChessRule.FIFTY_MOVES);
+ else
+ return false;
return true;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]