From: Terry Hearst Date: Fri, 17 Sep 2021 07:03:25 +0000 (-0400) Subject: Autoload variants.ini if specified in by an environment variable (#360) X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=4f3885107e990adb97f37dcc44b0998bcf5972d5;p=fairystockfish.git Autoload variants.ini if specified in by an environment variable (#360) --- diff --git a/src/uci.cpp b/src/uci.cpp index 5b5aaa7..ef6a6cf 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -16,6 +16,7 @@ along with this program. If not, see . */ +#include #include #include #include @@ -287,6 +288,19 @@ void UCI::loop(int argc, char* argv[]) { // UCCI banmoves state std::vector banmoves = {}; + if (argc > 1 && (std::strcmp(argv[1], "noautoload") == 0)) + { + cmd = ""; + argc = 1; + } + else if (argc == 1 || !(std::strcmp(argv[1], "load") == 0)) + { + // Check environment for variants.ini file + char *envVariantPath = std::getenv("FAIRY_STOCKFISH_VARIANT_PATH"); + if (envVariantPath != NULL) + Options["VariantPath"] = std::string(envVariantPath); + } + do { if (argc == 1 && !getline(cin, cmd)) // Block here waiting for input or EOF cmd = "quit";