[gnome-chess] Fixes chess timer gets reset to the max allowed on game restarts



commit 59e790e3bdd32a277debfb28864415058165e54c
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 1dc7f9e..7b7fb82 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -2047,12 +2047,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]