mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +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:
parent
249eec6715
commit
e58b3b4665
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue