Ticket #173: lively-stones-2b.diff

File lively-stones-2b.diff, 1.2 kB (added by gunnar, 5 months ago)

Second half of the patch.

  • engine/worm.c

    RCS file: /home/arend/Go/gnugo-rsync/gnugo/engine/worm.c,v
    retrieving revision 1.74
    diff -u -p -r1.74 worm.c
     
    17061706} 
    17071707 
    17081708 
     1709/* Find stones, that could live for sure, if player (color) moves 
     1710 * first. 
     1711 */ 
     1712 
    17091713void 
    17101714get_lively_stones(int color, signed char safe_stones[BOARDMAX]) 
    17111715{ 
     
    17131717  memset(safe_stones, 0, BOARDMAX * sizeof(*safe_stones)); 
    17141718  for (pos = BOARDMIN; pos < BOARDMAX; pos++) 
    17151719    if (IS_STONE(board[pos]) && find_origin(pos) == pos) { 
    1716       if ((stackp == 0 && worm[pos].attack_codes[0] == 0) || !attack(pos, NULL) 
     1720      if ((stackp == 0 && worm[pos].attack_codes[0] == 0) 
     1721           || !attack(pos, NULL) 
    17171722          || (board[pos] == color 
    1718               && ((stackp == 0 && worm[pos].defense_codes[0] != 0) 
    1719                   || find_defense(pos, NULL)))) 
     1723              && ((stackp == 0 && worm[pos].defense_codes[0] == WIN) 
     1724                  || find_defense(pos, NULL) == WIN))) 
    17201725        mark_string(pos, safe_stones, 1); 
    17211726    } 
    17221727}