Use returned depth in hash table
[hachu.git] / hachu.c
diff --git a/hachu.c b/hachu.c
index ffde08b..f058616 100644 (file)
--- a/hachu.c
+++ b/hachu.c
@@ -2027,6 +2027,7 @@ if(flag & depth >= 0) printf("%2d:%d found %d/%d %08x %s\n", depth, iterDep, cur
 \r
 if(flag & depth >= 0) printf("%2d:%d made %d/%d %s\n", depth, iterDep, curMove, msp, MoveToText(moveStack[curMove], 0));\r
       for(i=2; i<=cnt50; i+=2) if(repStack[level-i+200] == hashKeyH) {\r
+       retDep = iterDep;\r
        if(repDraws) { score = 0; goto repetition; }\r
        if(!allowRep) {\r
          moveStack[curMove] = 0;         // erase forbidden move\r
@@ -2146,7 +2147,7 @@ if(PATH) printf("%d:%2d:%d %3d %6x %-10s %6d %6d  (%d)\n", level, depth, iterDep
 #ifdef HASH\r
     // hash store\r
     hashTable[index].lock[hit]  = hashKeyH;\r
-    hashTable[index].depth[hit] = iterDep;\r
+    hashTable[index].depth[hit] = resDep;\r
     hashTable[index].score[hit] = bestScore;\r
     hashTable[index].flag[hit]  = (bestScore < beta) * H_UPPER;\r
     if(bestScore > alpha) {\r