Index: ai/aiunit.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/aiunit.c,v retrieving revision 1.296 diff -u -r1.296 aiunit.c --- ai/aiunit.c 27 Sep 2003 11:22:40 -0000 1.296 +++ ai/aiunit.c 27 Sep 2003 19:21:54 -0000 @@ -1819,8 +1819,6 @@ struct unit *ferryboat = NULL; /* Type of our boat (a future one if ferryboat == NULL) */ Unit_Type_id boattype = U_LAST; - bool unhap = FALSE; - struct city *pcity; /* this is a kluge, because if we don't set x and y with !punit->id, * p_a_w isn't called, and we end up not wanting ironclads and therefore * never learning steam engine, even though ironclads would be very @@ -1869,6 +1867,8 @@ /* dealing with invasion stuff */ if (IS_ATTACKER(aunit)) { if (aunit->activity == ACTIVITY_GOTO) { + struct city *pcity; + invasion_funct(aunit, TRUE, 0, (COULD_OCCUPY(aunit) ? 1 : 2)); if ((pcity = map_get_city(goto_dest_x(aunit), goto_dest_y(aunit)))) { pcity->ai.attack += unit_att_rating(aunit); @@ -1894,14 +1894,6 @@ * to avoid spreading out attacks too widely to be inefficient. */ - pcity = map_get_city(punit->x, punit->y); - - if (pcity && (punit->id == 0 || pcity->id == punit->homecity)) { - /* I would have thought unhappiness should be taken into account - * irrespectfully the city in which it will surface... GB */ - unhap = ai_assess_military_unhappiness(pcity, get_gov_pplayer(pplayer)); - } - move_rate = unit_type(punit)->move_rate; if (unit_flag(punit, F_IGTER)) { move_rate *= 3; @@ -2037,8 +2029,7 @@ vuln, victim_count); } } - want -= move_time * (unhap ? SHIELD_WEIGHTING + 2 * TRADE_WEIGHTING - : SHIELD_WEIGHTING); + want -= move_time * SHIELD_WEIGHTING; /* build_cost of ferry */ needferry = (go_by_boat && !ferryboat ? unit_value(boattype) : 0); /* FIXME: add time to build the ferry? */ @@ -2155,9 +2146,6 @@ /* Take into account maintainance of the unit */ /* FIXME: Depends on the government */ want -= move_time * SHIELD_WEIGHTING; - /* Take into account unhappiness - * (costs 2 luxuries to compensate) */ - want -= (unhap ? 2 * move_time * TRADE_WEIGHTING : 0); } want = military_amortize(pplayer, find_city_by_id(punit->homecity), want, MAX(1, move_time), bcost_bal);