[four-in-a-row] Game no longer hangs after specific actions.



commit b2d7061484994c40f3887c0eee13e57bad3a9c20
Author: Nikhar Agrawal <nikharagrawal2006 gmail com>
Date:   Sat Mar 1 23:17:36 2014 +0530

    Game no longer hangs after specific actions.
    
    Disabled undo button when computer makes the first move and human hasn't
    made a move yet. Disabling undo button makes sense because using undo
    button in this case did not serve any purpose.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723338

 src/main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index 7a3b12a..06eb906 100644
--- a/src/main.c
+++ b/src/main.c
@@ -642,7 +642,10 @@ on_game_hint (GSimpleAction *action, GVariant *parameter, gpointer data)
   set_status_message (s);
   g_free (s);
 
-  g_simple_action_set_enabled (G_SIMPLE_ACTION (undo_action), (moves > 0));
+  if (moves <= 0 || (moves == 1 && is_player_human ()))
+       g_simple_action_set_enabled (G_SIMPLE_ACTION (undo_action), FALSE);
+  else
+       g_simple_action_set_enabled (G_SIMPLE_ACTION (undo_action), TRUE);
 }
 
 void


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