Fix startpos_ply_counter() regression

Return the correct number of played plies at the end
of the setup moves. Currently it always returns 0 when
starting from start position, like in real games.

We fix this adding st->pliesFromNull that starts from 0
and is incremented after each setup move and is never
reset in the setup phase but only once search is started.

It is an hack because startpos_ply_counter() will return
different values during the search and is correct only
at the beginning of the search.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2011-07-24 05:59:16 +01:00
parent 5f7eb20090
commit fc290dc30b
2 changed files with 2 additions and 2 deletions

View File

@@ -423,7 +423,7 @@ inline bool Position::move_is_passed_pawn_push(Move m) const {
}
inline int Position::startpos_ply_counter() const {
return startPosPly;
return startPosPly + st->pliesFromNull; // HACK
}
inline bool Position::opposite_colored_bishops() const {