Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] (PR#2589) Prevent friendly city from getting generated whe
Home

[Freeciv-Dev] (PR#2589) Prevent friendly city from getting generated whe

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2589) Prevent friendly city from getting generated when a goodie hut is close to one of player's cities
From: "esr@xxxxxxxxxxx via RT" <rt@xxxxxxxxxxxxxx>
Date: Mon, 16 Dec 2002 04:35:11 -0800
Reply-to: rt@xxxxxxxxxxxxxx

This patch prevents a friendly city from getting generated by piling into a 
good, when the goodie hut is close to one of player's cities.

-- 
                <a href="http://www.tuxedo.org/~esr/";>Eric S. Raymond</a>

--- server/unittools.c  2002/12/16 12:19:07     1.1
+++ server/unittools.c  2002/12/16 12:19:53
@@ -2439,13 +2439,15 @@
 }
 
 /**************************************************************************
-  Get new city from hut, or settlers (nomads) if terrain is poor.
+  Get new city from hut, or settlers (nomads) if terrain is poor
+  or we're near another city,
 **************************************************************************/
 static void hut_get_city(struct unit *punit)
 {
   struct player *pplayer = unit_owner(punit);
   
-  if (city_can_be_built_here(punit->x, punit->y)) {
+  if (city_can_be_built_here(punit->x, punit->y) 
+               && !city_exists_within_city_radius(punit->x, punit->y, TRUE)) {
     notify_player_ex(pplayer, punit->x, punit->y, E_HUT_CITY,
                     _("Game: You found a friendly city."));
     create_city(pplayer, punit->x, punit->y,

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