From 6e534eadda282d7997724e6b8a08ed901c438eb5 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 28 Apr 2014 22:03:06 +0200 Subject: [PATCH] Fix hash key after setboard The initial hash key was the same in any start position. This resulted in a has-hit on the opening position, which was searched to make a move list after 'new', in the position after 'setboard', so the opening's hash move could be played in any position, even where it was completely invalid. --- hachu.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hachu.c b/hachu.c index 5893196..641de3b 100644 --- a/hachu.c +++ b/hachu.c @@ -12,7 +12,7 @@ #define VERSION "0.19" -//define PATH level==0 || path[0] == 0x1103a && (level==1 || path[1] == 0x6f0f6 && (level == 2 /*|| path[2] == 0x8710f && (level == 3 /*|| path[3] == 0x3e865 && (level == 4 || path[4] == 0x4b865 && (level == 5)))*/)) +//define PATH level==0/* || path[0] == 0x1103a && (level==1 || path[1] == 0x6f0f6 && (level == 2 /*|| path[2] == 0x8710f && (level == 3 /*|| path[3] == 0x3e865 && (level == 4 || path[4] == 0x4b865 && (level == 5)))))*/ #define PATH 0 #define HASH @@ -2334,7 +2334,7 @@ Setup2 (char *fen) SetUp(array, currentVariant); strcpy(startPos, array); sup0 = sup1 = sup2 = ABSENT; - hashKeyH = hashKeyL = 87620895*currentVariant; + hashKeyH = hashKeyL = 87620895*currentVariant + !!fen; return stm; } -- 1.7.0.4