[gnome-chess] Resigning should be possible on opponent's turn



commit 70e07d56f645f181cc1dd4bb5bb9be504de3f969
Author: Michael Catanzaro <mike catanzaro gmail com>
Date:   Mon May 20 21:11:17 2013 -0500

    Resigning should be possible on opponent's turn
    
    This reverts the previous resignation-related commit. Rather than
    disallowing resignation during the opponent's turn, simply make sure the
    human player is the one who loses. (Or the current player if there are
    two humans.)

 src/gnome-chess.vala |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index e80badd..835e120 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -845,7 +845,7 @@ public class Application : Gtk.Application
     
     private void update_control_buttons ()
     {
-        var can_resign = game.n_moves > 0 && game.current_player != opponent;
+        var can_resign = game.n_moves > 0;
         resign_menu.sensitive = resign_button.sensitive = can_resign;
 
         /* Can undo once the human player has made a move */
@@ -1018,7 +1018,10 @@ public class Application : Gtk.Application
     [CCode (cname = "G_MODULE_EXPORT resign_cb", instance_pos = -1)]
     public void resign_cb (Gtk.Widget widget)
     {
-        game.current_player.resign ();
+        if (human_player != null)
+            human_player.resign ();
+        else
+            game.current_player.resign ();
     }
 
     [CCode (cname = "G_MODULE_EXPORT claim_draw_cb", instance_pos = -1)]


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