[iagno/gnome-3-8] Fix Undo after human player has passed



commit d50f9b5d6ce403e417a90350745e88518c896d7d
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 4f7c1dd..dfc6105 100644
--- a/src/game.vala
+++ b/src/game.vala
@@ -285,8 +285,6 @@ public class Game
             else
                 current_color = Player.LIGHT;
         }
-
-        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 e4c201e..9f6af62 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -275,6 +275,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.undo (2);
+
+        game_move_cb (game);
     }
 
     private void about_cb ()


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