Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] Re: (PR#12836) AI Grabs Allies as City Guards
Home

[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]
To: badamson@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12836) AI Grabs Allies as City Guards
From: "Christian Knoke" <chrisk@xxxxxxxxx>
Date: Wed, 20 Apr 2005 14:03:34 -0700
Reply-to: bugs@xxxxxxxxxxx

<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.





[Prev in Thread] Current Thread [Next in Thread]