Complete.Org: Mailing Lists: Archives: freeciv-dev: November 1998:
[Freeciv-Dev] building obsolete wonders patch
Home

[Freeciv-Dev] building obsolete wonders patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] building obsolete wonders patch
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Tue, 10 Nov 1998 21:48:37 +1100

This patch allows you to always build wonders, even if obsolete,
as there seemed to be agreement that this should be so.

-- David
diff -u -r --exclude-from exclude freeciv-cvs/common/city.c 
freeciv-mod/common/city.c
--- freeciv-cvs/common/city.c   Sat Nov  7 13:53:52 1998
+++ freeciv-mod/common/city.c   Tue Nov 10 20:02:44 1998
@@ -526,7 +526,6 @@
 
 int could_build_improvement(struct city *pcity, enum improvement_type_id id)
 { /* modularized so the AI can choose the tech it wants -- Syela */
-  struct player *p=city_owner(pcity);
   if (!improvement_exists(id))
     return 0;
   if (city_got_building(pcity, id))
@@ -552,9 +551,12 @@
       && !is_terrain_near_tile(pcity->x, pcity->y, T_MOUNTAINS)
       && !is_terrain_near_tile(pcity->x, pcity->y, T_RIVER))
     return 0;
-  if(improvement_obsolete(p, id)) return 0;
-  if (is_wonder(id) && game.global_wonders[id])
-    return 0;
+  if (is_wonder(id)) {
+    if (game.global_wonders[id]) return 0;
+  } else {
+    struct player *pplayer=city_owner(pcity);
+    if (improvement_obsolete(pplayer, id)) return 0;
+  }
   return !wonder_replacement(pcity, id);
 }
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] building obsolete wonders patch, David Pfitzner <=