Ticket #169: draqo-worm.diff

File draqo-worm.diff, 1.9 kB (added by gunnar, 16 months ago)

Rediffed worm.diff, #ifdef'ed code removed instead

  • engine/worm.c

     
    298298           */ 
    299299          if (worm[str].color == OTHER_COLOR(color) 
    300300              && worm[str].attack_codes[0] != 0 
     301              && worm[str].attack_points[0] != pos 
    301302              && worm[str].defense_codes[0] != 0) { 
    302303            int dcode = find_defense(str, NULL); 
    303304            if (dcode < worm[str].defense_codes[0]) { 
     
    343344           * pos. 
    344345           */ 
    345346          else if (worm[str].color == color 
    346                    && worm[str].attack_codes[0] != 0) { 
     347                   && worm[str].attack_codes[0] != 0 
     348                   && worm[str].defense_points[0] != pos) { 
    347349            int acode = attack(str, NULL); 
    348350            if (acode < worm[str].attack_codes[0]) { 
    349351              int defense_works = 1; 
     
    785787        if (defense_point != NO_MOVE) 
    786788          change_defense(str, defense_point, dcode); 
    787789      } 
    788       else { 
    789         /* If the point of attack is not adjacent to the worm,  
    790          * it is possible that this is an overlooked point of 
    791          * defense, so we try and see if it defends. 
    792          */ 
    793         attack_point = worm[str].attack_points[0]; 
    794         if (!liberty_of_string(attack_point, str)) 
    795           if (trymove(attack_point, worm[str].color, "make_worms", NO_MOVE)) { 
    796             int acode = attack(str, NULL); 
    797             if (acode != WIN) { 
    798               change_defense(str, attack_point, REVERSE_RESULT(acode)); 
    799               TRACE("worm at %1m can be defended at %1m with code %d\n", 
    800                     str, attack_point, REVERSE_RESULT(acode)); 
    801             }     
    802             popgo(); 
    803           } 
    804       } 
    805790    } 
    806791  } 
    807792  gg_assert(stackp == 0); 
     
    854839      /* Try to defend at the liberty. */ 
    855840      if (!defense_move_known(pos, str)) { 
    856841        if (worm[str].defense_codes[0] != 0) 
    857           if (trymove(pos, color, "make_worms", NO_MOVE)) { 
     842          if (fastlib(pos, other, 0) != 1 
     843              && trymove(pos, color, "make_worms", NO_MOVE)) { 
    858844            acode = attack(str, NULL); 
    859845            if (acode != WIN) 
    860846              change_defense(str, pos, REVERSE_RESULT(acode));