[Freeciv-Dev] Re: (PR#12836) AI Grabs Allies as City Guards
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12836 >
On Wed, Apr 20, 2005 at 12:49:11PM -0700, Per I. Mathisen wrote:
>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12836 >
>
> On Mon, 18 Apr 2005, Benedict Adamson wrote:
> > The function ai_set_defenders considers *all* units in a city as
> > potential city guards. It will therefore consider allied units that
> > happen to be present, including units owned by human players.
I've seen this often, and found this somewhat clever.. ;) Why not trust an
ally?
> Ooops...
>
> --- ai/aiunit.c 13 Apr 2005 18:19:11 -0000 1.353
> +++ ai/aiunit.c 20 Apr 2005 19:48:10 -0000
> @@ -2164,7 +2164,8 @@
>
> unit_list_iterate(pcity->tile->units, punit) {
> if ((punit->ai.ai_role == AIUNIT_NONE || emergency)
> - && punit->ai.ai_role != AIUNIT_DEFEND_HOME) {
> + && punit->ai.ai_role != AIUNIT_DEFEND_HOME
> + && punit->owner == pplayer->player_no) {
> int want = assess_defense_unit(pcity, punit, FALSE);
>
> ...then.
>
> - Per
Christian
--
Christian Knoke * * * http://cknoke.de
* * * * * * * * * Ceterum censeo Microsoft esse dividendum.
|
|