From 0643721e0697ddec902253174450b036557a54b6 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sat, 14 Jan 2017 18:40:30 +0100 Subject: [PATCH] Assert no unexpected King capture A hash-key collision sometimes leaves a King up for grabs. --- dropper.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dropper.c b/dropper.c index bc6540e..e5883d2 100644 --- a/dropper.c +++ b/dropper.c @@ -1134,7 +1134,11 @@ if(PATH)printf("%d:%d {%d,%d} max=%d eval=%d check=%02x,%d,%d\n",ply,depth,alp } // 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 -- 1.7.0.4