[iagno] Fix Undo after human player has passed



commit adfcc8812c5e4c9a934243c511b164bbf7efb206
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Sep 29 19:31:19 2013 -0500

    Fix Undo after human player has passed
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679133

 src/game.vala  |    2 --
 src/iagno.vala |    6 ++++++
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/game.vala b/src/game.vala
index 3866167..296a93a 100644
--- a/src/game.vala
+++ b/src/game.vala
@@ -256,8 +256,6 @@ public class Game : Object
             /* Previous player to move again */
             current_color = Player.flip_color (current_color);
         }
-
-        move ();
     }
 
     private void set_tile (int x, int y, Player color, bool update_history)
diff --git a/src/iagno.vala b/src/iagno.vala
index 69c091c..981398a 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -271,6 +271,12 @@ public class Iagno : Gtk.Application
             game.undo (1);
         else
             game.undo (2);
+
+        /* If forced to pass, undo to last chosen move */
+        while (!game.can_move (game.current_color))
+            game.undo (2);
+
+        game_move_cb (game);
     }
 
     private void about_cb ()


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