Ticket #161: gunnar_7_11.5.diff

File gunnar_7_11.5.diff, 1.8 KB (added by gunnar, 4 years ago)

Possible fix.

  • engine/combination.c

     
    408408  memset(forbidden, 0, sizeof(forbidden)); 
    409409  memset(defense_points, 0, sizeof(defense_points)); 
    410410 
     411  compute_aa_status(other, safe_stones); 
     412  compute_aa_values(other); 
     413 
    411414  /* Accept illegal ko capture here. */ 
    412415  if (!tryko(move, color, NULL)) 
    413416    /* Really shouldn't happen. */ 
    414417    abortgo(__FILE__, __LINE__, "trymove", move); 
    415418 
    416   compute_aa_status(other, safe_stones); 
    417   compute_aa_values(other); 
    418  
    419419  increase_depth_values(); 
    420420 
    421421  aa_val = do_atari_atari(other, &apos, &defense_point, defense_points, 
     
    518518 
    519519/* Helper function for computing the aa_status for all opponent's strings. 
    520520 * If safe_stones is given, we just copy the information from there. 
     521 * If called at stackp > 0, safe_stones must be provided since the 
     522 * dragon_data is not valid then. 
    521523 */ 
    522524 
    523525static void 
     
    528530  SGFTree *save_sgf_dumptree = sgf_dumptree; 
    529531  int save_count_variations = count_variations; 
    530532  int save_verbose = verbose; 
     533 
     534  gg_assert(safe_stones || stackp == 0); 
     535   
    531536  sgf_dumptree = NULL; 
    532537  count_variations = 0; 
    533538  if (verbose) 
     
    572577   */ 
    573578  for (pos = BOARDMIN; pos < BOARDMAX; pos++) { 
    574579    if (board[pos] == other 
    575         && worm[pos].origin == pos 
    576         && worm[pos].liberties == 2 
     580        && find_origin(pos) == pos 
     581        && countlib(pos) == 2 
    577582        && aa_status[pos] == ALIVE) { 
    578583      int libs[2]; 
    579584      findlib(pos, 2, libs); 
     
    587592      if (!owl_substantial(pos)) { 
    588593        int pos2; 
    589594        for (pos2 = BOARDMIN; pos2 < BOARDMAX; pos2++) 
    590           if (ON_BOARD(pos2) && is_worm_origin(pos2, pos)) 
     595          if (board[pos2] == other && find_origin(pos2) == pos) 
    591596            aa_status[pos2] = INSUBSTANTIAL; 
    592597      } 
    593598    }