Re: [Freeciv-Dev] (PR#13295) swapping cities for tech
"Per I. Mathisen" <per-0/[email protected]> Wed, 20 Jul 2005 11:32:16 -0700
| Newsgroups | gmane.games.freeciv.ai |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format...
------------=_1121884336-7773-1
Content-Type: text/plain; charset="utf-8"
<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
------------=_1121884336-7773-1
Content-Type: text/plain; charset="US-ASCII"; name="donotsell1.diff"
Content-Disposition: inline; filename="donotsell1.diff"
Content-Transfer-Encoding: 7bit
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;
------------=_1121884336-7773-1--