? core.11735 ? saves Index: ai/advmilitary.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/advmilitary.c,v retrieving revision 1.128 diff -u -r1.128 advmilitary.c --- ai/advmilitary.c 2003/01/02 11:59:28 1.128 +++ ai/advmilitary.c 2003/01/02 12:16:15 @@ -1021,6 +1021,7 @@ bool go_by_boat; /* Is the defender veteran? */ bool def_vet; + int fstk; if (pcity->ai.danger != 0 && assess_defense(pcity) == 0) { /* Defence comes first! */ @@ -1049,7 +1050,7 @@ } boatspeed = unit_types[boattype].move_rate; - (void) find_something_to_kill(pplayer, myunit, &x, &y); + fstk = find_something_to_kill(pplayer, myunit, &x, &y); acity = map_get_city(x, y); @@ -1104,7 +1105,8 @@ int m = unit_vulnerability_virtual2(att_type, pdef->type, x, y, FALSE, pdef->veteran, myunit->id != 0, pdef->hp); - if (vuln < m) { + if (vuln <= m) { + /* The present defender (pdef) is good enough */ vuln = m; benefit = unit_type(pdef)->build_cost; def_vet = pdef->veteran; @@ -1116,12 +1118,6 @@ /* boats can't conquer cities */ benefit += 40; } - if (!unit_really_ignores_citywalls(myunit) && !city_got_citywalls(acity) - && move_time > (player_knows_improvement_tech(city_owner(acity), - B_CITY) ? 2 : 4)) { - /* Might get walls before we get there */ - vuln *= 9; - } /* end dealing with cities */ } else { @@ -1190,6 +1186,12 @@ : SHIELD_WEIGHTING); want = military_amortize(pplayer, pcity, want, MAX(1, move_time), bcost_bal + needferry); + + if (fstk != want) { + freelog(LOG_ERROR, "fstk (%d) is different from want (%d) in k_s_w in" + " year %d", fstk, want, game.year); + assert(0); + } if (myunit->id != 0) { freelog(LOG_ERROR, "ERROR: Non-virtual unit in kill_something_with"); Index: ai/aiunit.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/aiunit.c,v retrieving revision 1.248 diff -u -r1.248 aiunit.c --- ai/aiunit.c 2003/01/02 11:59:29 1.248 +++ ai/aiunit.c 2003/01/02 12:16:16 @@ -1849,7 +1849,7 @@ acity->y, FALSE, do_make_unit_veteran(acity, def_type), FALSE, 0); - if (v >= vuln) { + if (v > vuln) { /* They can build a better defender! */ vuln = v; benefit = unit_types[def_type].build_cost;