mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 08:37:44 +00:00
Fix wrong mate sign
introduced yesterday by the UCI refactoring 9032c6cbe
fixes #5166
closes https://github.com/official-stockfish/Stockfish/pull/5167
No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
249eec6715
commit
e58b3b4665
+2
-2
@@ -360,12 +360,12 @@ std::string UCIEngine::format_score(const Score& s) {
|
|||||||
constexpr int TB_CP = 20000;
|
constexpr int TB_CP = 20000;
|
||||||
const auto format =
|
const auto format =
|
||||||
overload{[](Score::Mate mate) -> std::string {
|
overload{[](Score::Mate mate) -> std::string {
|
||||||
auto m = (mate.plies > 0 ? (mate.plies + 1) : -mate.plies) / 2;
|
auto m = (mate.plies > 0 ? (mate.plies + 1) : mate.plies) / 2;
|
||||||
return std::string("mate ") + std::to_string(m);
|
return std::string("mate ") + std::to_string(m);
|
||||||
},
|
},
|
||||||
[](Score::TBWin tb) -> std::string {
|
[](Score::TBWin tb) -> std::string {
|
||||||
return std::string("cp ")
|
return std::string("cp ")
|
||||||
+ std::to_string((tb.plies > 0 ? TB_CP - tb.plies : -TB_CP + tb.plies));
|
+ std::to_string((tb.plies > 0 ? TB_CP - tb.plies : -TB_CP - tb.plies));
|
||||||
},
|
},
|
||||||
[](Score::InternalUnits units) -> std::string {
|
[](Score::InternalUnits units) -> std::string {
|
||||||
return std::string("cp ") + std::to_string(units.value);
|
return std::string("cp ") + std::to_string(units.value);
|
||||||
|
|||||||
Reference in New Issue
Block a user