]> git.sesse.net Git - stockfish/commit
Allow Position::init() to be called more than once
authorMarco Costalba <mcostalba@gmail.com>
Fri, 10 Apr 2015 06:57:35 +0000 (08:57 +0200)
committerJoona Kiiski <joona.kiiski@gmail.com>
Fri, 10 Apr 2015 19:39:15 +0000 (20:39 +0100)
commita66c73deef420104e74b6645ee60e20b37fd8549
tree4af1109dc1cdf16f8f19521960bfc25c70f31009
parent27efc5ac996ffc679395317c8bbb16aca996296c
Allow Position::init() to be called more than once

Currently Zobrist::castling[] are not properly zeroed
and rely on the compiler to do this at startup, but this
makes Position::init() to set different values every time
it is called!

This is a bit odd, and although not impacting normal usage,
can yield to subtle misbehaviour, very difficult to track
down, in case we happen to call it more than once for some
reason. I found this while developing tuning support and
it took me a while to track it down.

So properly init Zobrist::castling[]

No functional change.

Resolves #329
src/position.cpp
src/ucioption.cpp