Fix Stockfish engine integration
Stockfish seems to go a bit nuts if passed an empty string for command-line arguments. https://bugzilla.gnome.org/show_bug.cgi?id=696474
This commit is contained in:
parent
f4b137e318
commit
592754bed0
4 changed files with 6 additions and 4 deletions
|
@ -4,7 +4,7 @@ public class AIProfile
|
||||||
public string protocol;
|
public string protocol;
|
||||||
public string binary;
|
public string binary;
|
||||||
public string path;
|
public string path;
|
||||||
public string args = "";
|
public string args;
|
||||||
public string[] easy_options;
|
public string[] easy_options;
|
||||||
public string[] normal_options;
|
public string[] normal_options;
|
||||||
public string[] hard_options;
|
public string[] hard_options;
|
||||||
|
@ -41,6 +41,8 @@ public List<AIProfile> load_ai_profiles (string filename)
|
||||||
profile.binary = file.get_value (name, "binary");
|
profile.binary = file.get_value (name, "binary");
|
||||||
if (file.has_key (name, "args"))
|
if (file.has_key (name, "args"))
|
||||||
profile.args = file.get_value (name, "args");
|
profile.args = file.get_value (name, "args");
|
||||||
|
else
|
||||||
|
profile.args = null; // bgo#696474
|
||||||
profile.easy_options = load_options (file, name, "easy");
|
profile.easy_options = load_options (file, name, "easy");
|
||||||
profile.normal_options = load_options (file, name, "normal");
|
profile.normal_options = load_options (file, name, "normal");
|
||||||
profile.hard_options = load_options (file, name, "hard");
|
profile.hard_options = load_options (file, name, "hard");
|
||||||
|
|
|
@ -4,7 +4,7 @@ public class ChessEngineCECP : ChessEngine
|
||||||
private bool moving = false;
|
private bool moving = false;
|
||||||
private string[] options;
|
private string[] options;
|
||||||
|
|
||||||
public ChessEngineCECP (string binary, string args, string[] options)
|
public ChessEngineCECP (string binary, string? args, string[] options)
|
||||||
{
|
{
|
||||||
base (binary, args);
|
base (binary, args);
|
||||||
this.options = options;
|
this.options = options;
|
||||||
|
|
|
@ -5,7 +5,7 @@ public class ChessEngineUCI : ChessEngine
|
||||||
private string[] options;
|
private string[] options;
|
||||||
private bool waiting_for_move;
|
private bool waiting_for_move;
|
||||||
|
|
||||||
public ChessEngineUCI (string binary, string args, string[] options)
|
public ChessEngineUCI (string binary, string? args, string[] options)
|
||||||
{
|
{
|
||||||
base (binary, args);
|
base (binary, args);
|
||||||
this.options = options;
|
this.options = options;
|
||||||
|
|
|
@ -30,7 +30,7 @@ public abstract class ChessEngine : Object
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChessEngine (string binary, string args)
|
public ChessEngine (string binary, string? args)
|
||||||
{
|
{
|
||||||
this.binary = binary;
|
this.binary = binary;
|
||||||
this.args = args;
|
this.args = args;
|
||||||
|
|
Loading…
Reference in a new issue