A hash-key collision sometimes leaves a King up for grabs.
}
// move generation
- if(!earlyGen) MoveGen(stm, &m, f.rights); // generate moves if we had not done so yet
+ if(!earlyGen) { // generate moves if we had not done so yet
+ if(MoveGen(stm, &m, f.rights)) { // impossible (except for hash collision giving wrong in-check status)
+ Dump("King capture");
+ }
+ }
if(hashMove) moveStack[--m.firstMove] = hashMove; // put hash move in front of list (duplicat!)
if(f.checker != CK_NONE) moveSP = m.drops = m.castlings; // clip off castlings when in check