[gnome-chess] Fix check for human player in update_headerbar_title



commit 221e06e5e98a05f8fb5d5d3a5ccb665638abfec3
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Tue Apr 24 11:46:35 2018 -0500

    Fix check for human player in update_headerbar_title
    
    The goal is to print a warning about check if it's the human's turn, but
    this would be broken if computer vs. computer games were supported.

 src/gnome-chess.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index cd154ca..9bae932 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -1196,8 +1196,8 @@ Copyright © 2015–2016 Sahil Sareen""";
 
     private void update_headerbar_title ()
     {
-        if ((human_player == null ||
-             human_player.color == game.current_player.color) &&
+        if (human_player != null &&
+            human_player.color == game.current_player.color &&
             game.current_state.is_in_check (game.current_player))
         {
             if (game.current_player.color == Color.WHITE)


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