Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] (PR#6076) Bug & patch: Firstbuild unit with building requi
Home

[Freeciv-Dev] (PR#6076) Bug & patch: Firstbuild unit with building requi

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#6076) Bug & patch: Firstbuild unit with building requirement
From: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Date: Mon, 8 Sep 2003 09:16:44 -0700
Reply-to: rt@xxxxxxxxxxxxxx


  There is bug for L_FIRSTBUILD units with building requirement. When 
new city is founded, unit to build is selected while improvement list is 
still uninitialized. In theory, this can lead to city building unit that 
it should be unable to build.
  Fix attached.

  - Caz


diff common/city.c common/city.c
--- common/city.c       2003-08-31 08:09:24.000000000 +0300
+++ common/city.c       2003-09-08 20:32:00.000000000 +0300
@@ -2489,6 +2489,12 @@
   pcity->trade_prod = 0;
   pcity->tile_trade = 0;
   pcity->original = pplayer->player_no;
+
+  /* Initialise list of improvements with City- and Building-wide 
+   * equiv_range */
+  improvement_status_init(pcity->improvements,
+                          ARRAY_SIZE(pcity->improvements));
+
   {
     int u = best_role_unit(pcity, L_FIRSTBUILD);
 
@@ -2508,11 +2514,6 @@
   /* Set up the worklist */
   init_worklist(&pcity->worklist);
 
-  /* Initialise list of improvements with City- and Building-wide 
-   * equiv_range */
-  improvement_status_init(pcity->improvements,
-                          ARRAY_SIZE(pcity->improvements));
-
   pcity->turn_last_built = game.year;
   pcity->changed_from_id = 0;
   pcity->changed_from_is_unit = FALSE;

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#6076) Bug & patch: Firstbuild unit with building requirement, Marko Lindqvist <=