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: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Wed, 20 Apr 2005 12:49:11 -0700
Reply-to: bugs@xxxxxxxxxxx

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

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





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