From 3c4fd47e765b551599fd18fcf65dc10153c0418b Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sun, 15 Nov 2020 14:26:46 +0100 Subject: [PATCH] Fix NNUE detection for absolute paths Check the file name, not the full path, for prefix with the variant name. --- src/evaluate.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 2b6f814..4bb3c29 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -88,11 +88,14 @@ namespace Eval { constexpr char SepChar = ';'; #endif while (getline(ss, eval_file, SepChar)) - if (eval_file.rfind(variant, 0) != string::npos || (variant == "chess" && eval_file.rfind("nn-", 0) != string::npos)) + { + string basename = eval_file.substr(eval_file.find_last_of("\\/") + 1); + if (basename.rfind(variant, 0) != string::npos || (variant == "chess" && basename.rfind("nn-", 0) != string::npos)) { useNNUE = true; break; } + } if (!useNNUE) return; -- 1.7.0.4