Index: ai/advmilitary.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/advmilitary.c,v retrieving revision 1.154 diff -u -r1.154 advmilitary.c --- ai/advmilitary.c 2003/09/23 18:43:23 1.154 +++ ai/advmilitary.c 2003/10/19 15:45:19 @@ -931,7 +931,7 @@ /* Type of the boat (real or a future one) */ Unit_Type_id boattype = U_LAST; int boatspeed; - bool go_by_boat; + bool go_by_boat, go_by_boat_best = FALSE; /* Is the defender veteran? */ bool def_vet; struct ai_choice best_choice; @@ -955,6 +955,7 @@ } if (is_ground_unit(myunit)) { + /* Attacker and bodyguard makes two */ int boatid = find_boat(pplayer, &bx, &by, 2); ferryboat = player_find_unit_by_id(pplayer, boatid); } @@ -1034,6 +1035,9 @@ if (COULD_OCCUPY(myunit) || TEST_BIT(acity->ai.invasion, 0)) { /* bonus for getting the city */ benefit += 40; + if (ai_handicap(pplayer, H_EXPERIMENTAL)) { + benefit -= 10; + } } /* end dealing with cities */ @@ -1063,13 +1067,32 @@ if (best_choice.want > choice->want) { /* We want attacker more that what we have selected before */ + go_by_boat_best = (go_by_boat && !ferryboat); copy_if_better_choice(&best_choice, choice); - if (go_by_boat && !ferryboat) { + if (!ai_handicap(pplayer, H_EXPERIMENTAL)) { + if (go_by_boat_best) { ai_choose_ferryboat(pplayer, pcity, choice); } - freelog(LOG_DEBUG, "%s has chosen attacker, %s, want=%d", - pcity->name, unit_types[choice->choice].name, choice->want); - } + } + freelog(LOG_DEBUG, "%s has chosen attacker, %s, want=%d " + "go_by_boat=%d ferryboat=%d", + pcity->name, unit_types[choice->choice].name, choice->want, + go_by_boat, !!ferryboat); + } + + /* Only go for a boat if best choice needs it */ + if (ai_handicap(pplayer, H_EXPERIMENTAL)) { + if (go_by_boat_best) { + if (unit_types[choice->choice].move_type == LAND_MOVING) { + ai_choose_ferryboat(pplayer, pcity, choice); + } + freelog(LOG_DEBUG, "%s has chosen attacker(ferryboat), %s, want=%d " + "go_by_boat=%d ferryboat=%d", + pcity->name, unit_types[choice->choice].name, + choice->want, + go_by_boat, !!ferryboat); + } + } } /**********************************************************************