Complete.Org: Mailing Lists: Archives: freeciv-dev: July 1999:
[Freeciv-Dev] new citizens city option seems to not always work (PR#72)
Home

[Freeciv-Dev] new citizens city option seems to not always work (PR#72)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] new citizens city option seems to not always work (PR#72)
From: jjm@xxxxxxxxxxxx
Date: Sat, 24 Jul 1999 21:07:13 -0700 (PDT)

Full_Name: Jeff Mallatt
Version: 1.8.1
OS: Linux
Submission from: (NULL) (199.103.194.35)


When I set the City Options "Make new citizens" to something other than
Workers, sometimes, when the city grows, it doesn't do what I told it.

The reason is that, regardless of the "Make new citizens" setting, if the city
has less than 2 surplus Food, it *always* makes a worker.  This is OK for small
cities, but if a city is large and is already working *all* available
surrounding
squares, the new worker mutates into an Elvis!  Definitely not what the player
wants.

This patch checks for available squares, and if there are none, then respects
the "Make new citizens" setting.

diff -Nur freeciv-old/server/cityturn.c freeciv/server/cityturn.c
--- freeciv-old/server/cityturn.c       Wed Jul 21 07:58:54 1999
+++ freeciv/server/cityturn.c   Sat Jul 24 13:46:48 1999
@@ -793,7 +795,12 @@
 
   /* If there is enough food, and the city is big enough,
    * make new citizens into scientists or taxmen -- Massimo */
-  if (pcity->food_surplus >= 2  &&  pcity->size >= 5  &&
+  /* Ignore food if no square can be worked */
+  have_square = FALSE;
+  city_map_iterate(x, y)
+    if (can_place_worker_here(pcity, x, y))
+      have_square = TRUE;
+  if (((pcity->food_surplus >= 2) || !have_square)  &&  pcity->size >= 5  &&
       (pcity->city_options & ((1<<CITYO_NEW_EINSTEIN) |
(1<<CITYO_NEW_TAXMAN)))) {
 
     if (pcity->city_options & (1<<CITYO_NEW_EINSTEIN)) {



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] new citizens city option seems to not always work (PR#72), jjm <=