[gnome-chess/gnome-3-14] Fixes chess timer gets reset to the max allowed on game restarts
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess/gnome-3-14] Fixes chess timer gets reset to the max allowed on game restarts
- Date: Fri, 26 Dec 2014 16:37:18 +0000 (UTC)
commit eced0f5457cffc528682205a166b47def0aebb0a
Author: Sahil Sareen <sahil sareen hotmail com>
Date: Thu Dec 25 16:12:35 2014 +0530
Fixes chess timer gets reset to the max allowed on game restarts
Save the timer correctly on game close.
https://bugzilla.gnome.org/show_bug.cgi?id=741657
src/gnome-chess.vala | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 5113f0f..a4c5953 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -2025,12 +2025,14 @@ public class ChessApplication : Gtk.Application
if (game.clock != null)
{
/* We currently only support simple timeouts */
- uint initial_time = int.parse (pgn_game.time_control);
+ uint white_initial_time = int.parse (pgn_game.white_time_left);
+ uint black_initial_time = int.parse (pgn_game.black_time_left);
+
uint white_used = game.clock.white_seconds_used;
uint black_used = game.clock.black_seconds_used;
- pgn_game.white_time_left = (initial_time - white_used).to_string ();
- pgn_game.black_time_left = (initial_time - black_used).to_string ();
+ pgn_game.white_time_left = (white_initial_time - white_used).to_string ();
+ pgn_game.black_time_left = (black_initial_time - black_used).to_string ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]