projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
4abe68a
)
Prevent division by zero in extinction bonus
author
Fabian Fichter
<ianfab@users.noreply.github.com>
Thu, 5 Aug 2021 14:42:54 +0000 (16:42 +0200)
committer
Fabian Fichter
<ianfab@users.noreply.github.com>
Thu, 5 Aug 2021 14:42:54 +0000 (16:42 +0200)
Fixes #340.
src/evaluate.cpp
patch
|
blob
|
history
diff --git
a/src/evaluate.cpp
b/src/evaluate.cpp
index
0e0dd46
..
b59df81
100644
(file)
--- a/
src/evaluate.cpp
+++ b/
src/evaluate.cpp
@@
-1230,7
+1230,7
@@
namespace {
else if (pos.extinction_value() == VALUE_MATE)
{
// Losing chess variant bonus
- score += make_score(pos.non_pawn_material(Us), pos.non_pawn_material(Us)) / pos.count<ALL_PIECES>(Us);
+ score += make_score(pos.non_pawn_material(Us), pos.non_pawn_material(Us)) / std::max(pos.count<ALL_PIECES>(Us), 1);
}
else if (pos.count<PAWN>(Us) == pos.count<ALL_PIECES>(Us))
{