Complete.Org: Mailing Lists: Archives: freeciv-ai: July 2005:
[freeciv-ai] Re: [Freeciv-Dev] (PR#13295) swapping cities for tech
Home

[freeciv-ai] Re: [Freeciv-Dev] (PR#13295) swapping cities for tech

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: fishpark77@xxxxxxxxxxx
Subject: [freeciv-ai] Re: [Freeciv-Dev] (PR#13295) swapping cities for tech
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Wed, 20 Jul 2005 11:32:16 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13295 >

On Mon, 20 Jun 2005, Fishpark wrote:
> But in one game I have been able to acquire the
> Lithuanians' only remaining city (thereby removing
> them from the game) because their capital city was
> unknown to me.
>
> You shouldn't be able to buy a capital city, even if
> you don't know the city is the capital.

No, you should not be able to, and as far as I read the code this is
impossible. However, there is another possibility - that the Lithuanian's
capital had lost its Palace, and therefore was no longer counted as a
capital. So this patch adds additional checks to ensure that the AI will
never sell its last cities.

  - Per

Index: ai/advdiplomacy.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdiplomacy.c,v
retrieving revision 1.84
diff -u -r1.84 advdiplomacy.c
--- ai/advdiplomacy.c   20 Jul 2005 18:28:48 -0000      1.84
+++ ai/advdiplomacy.c   20 Jul 2005 18:30:30 -0000
@@ -454,7 +454,7 @@
     } else if (give) {
       /* AI must be crazy to trade away its cities */
       worth -= city_gold_worth(offer);
-      if (is_capital(offer)) {
+      if (is_capital(offer) || city_list_size(pplayer->cities) < 3) {
         worth = -BIG_NUMBER; /* Never! Ever! */
       } else {
         worth *= 15;

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