[iagno/gnome-3-10] Fix computer vs. computer new game



commit 2dde02b9980bb4e2c38a36dbe90df88458973b09
Author: Dave Paul <hi my name is dave gmail com>
Date:   Wed Sep 18 22:47:21 2013 -0600

    Fix computer vs. computer new game
    
    Previously, if you started a new computer vs. computer game while
    another was already in progress, the computer would start playing
    too often, resulting in all kinds of problems.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708343

 src/iagno.vala |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/iagno.vala b/src/iagno.vala
index 169a95e..15ab00d 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -364,11 +364,14 @@ public class Iagno : Gtk.Application
 
     private bool computer_move_cb ()
     {
+        /* set computer_timer to 0 *before* calling move() since that will
+         * call game_move_cb and possibly create a new timer.
+         */
+        computer_timer = 0;
         if (game.current_color == Player.LIGHT)
             light_computer.move ();
         else
             dark_computer.move ();
-        computer_timer = 0;
         return false;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]