[gnome-chess/gnome-3-8] With no engines installed, human should be able to control both players
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess/gnome-3-8] With no engines installed, human should be able to control both players
- Date: Sun, 9 Jun 2013 02:01:27 +0000 (UTC)
commit a4b306fdb9aae7f98c90f0480f7349554a0c7857
Author: Michael Catanzaro <mike catanzaro gmail com>
Date: Sat Jun 8 20:56:59 2013 -0500
With no engines installed, human should be able to control both players
Currently you hit a problem when you load a game that had originally
been against an engine, but have no engine installed. Fallback to human
control in this case.
Regression introduced in 894a74a885ebce0d197700aa3e9b600331a18dfa
(cherry picked from commit 79087ca62e76063011853f22ea0c1edd442f4499)
src/gnome-chess.vala | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 13f9edf..54c7df4 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -451,6 +451,7 @@ public class Application : Gtk.Application
opponent_engine.stopped.disconnect (engine_stopped_cb);
opponent_engine = null;
}
+
if (white_engine != null)
{
opponent = game.white;
@@ -467,13 +468,14 @@ public class Application : Gtk.Application
opponent.local_human = false;
human_player.local_human = true;
}
- else
+
+ /* Game saved vs. human, or game saved vs. engine but none installed */
+ if (opponent_engine == null)
{
game.black.local_human = true;
game.white.local_human = true;
}
-
- if (opponent_engine != null)
+ else
{
opponent_engine.ready_changed.connect (engine_ready_cb);
opponent_engine.moved.connect (engine_move_cb);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]