Check-in modifications made by HGM so far
[capablanca.git] / lasker-2.2.3 / src / talkproc.c
index 1016fc5..34283b5 100644 (file)
@@ -472,6 +472,19 @@ int com_kibitz(int p, param_list param)
     g = pp->game;
   else
     g = pp->observe_list[0];
+  if(pp->game == g) { // [HGM] capture engine kibitz of player
+    float score; int depth;
+    if(sscanf(param[0].val.string, "!!! %f/%d", &score, &depth) == 2) {
+      struct game *gg = &game_globals.garray[g];
+      if(gg->numHalfMoves && gg->status == GAME_ACTIVE) {
+       int n = gg->numHalfMoves-1;
+       if(n && (gg->game_state.onMove == WHITE && gg->black != p ||
+                gg->game_state.onMove == BLACK && gg->white != p   )) n--;
+       gg->moveList[n].score = score;
+       gg->moveList[n].depth = depth;
+      }
+    }
+  }
   for (p1 = 0; p1 < player_globals.p_num; p1++) {
     if ((p1 == p) || (player_globals.parray[p1].status != PLAYER_PROMPT))
       continue;