Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] (PR#11257) replace wonder_obsolete
Home

[Freeciv-Dev] (PR#11257) replace wonder_obsolete

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11257) replace wonder_obsolete
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 29 Nov 2004 14:04:53 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=11257 >

This patch removes wonder_obsolete().  Its users now call 
improvement_obsolete().

However I suspect some of its improvements are erronous.  Non-wonder 
buildings can go obsolete as well but you need to pass in a player 
parameter to find out.

jason

Index: ai/aitech.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aitech.c,v
retrieving revision 1.45
diff -u -r1.45 aitech.c
--- ai/aitech.c 25 Jun 2004 23:43:01 -0000      1.45
+++ ai/aitech.c 29 Nov 2004 21:50:02 -0000
@@ -48,7 +48,7 @@
   
   if (improvement_exists(building)
       && game.global_wonders[building] == 0
-      && !wonder_obsolete(building)) {
+      && !improvement_obsolete(NULL, building)) {
     Tech_Type_id tech = improvement_types[building].tech_req;
 
     if (tech_is_available(plr, tech) 
Index: client/citydlg_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/citydlg_common.c,v
retrieving revision 1.50
diff -u -r1.50 citydlg_common.c
--- client/citydlg_common.c     16 Oct 2004 00:00:10 -0000      1.50
+++ client/citydlg_common.c     29 Nov 2004 21:50:02 -0000
@@ -349,7 +349,7 @@
          if (game.global_wonders[id] != 0) {
            state = _("Built");
          }
-         if (wonder_obsolete(id)) {
+         if (improvement_obsolete(NULL, id)) {
            state = _("Obsolete");
          }
        }
Index: client/gui-mui/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/citydlg.c,v
retrieving revision 1.86
diff -u -r1.86 citydlg.c
--- client/gui-mui/citydlg.c    25 Nov 2004 23:26:53 -0000      1.86
+++ client/gui-mui/citydlg.c    29 Nov 2004 21:50:03 -0000
@@ -604,7 +604,7 @@
            sz_strlcpy(info, _("Wonder"));
            if (game.global_wonders[which])
              sz_strlcpy(info, _("Built"));
-           if (wonder_obsolete(which))
+           if (improvement_obsolete(NULL, which))
              sz_strlcpy(info, _("Obsolete"));
          }
        }
Index: client/gui-mui/worklistclass.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/worklistclass.c,v
retrieving revision 1.26
diff -u -r1.26 worklistclass.c
--- client/gui-mui/worklistclass.c      25 Feb 2004 20:09:51 -0000      1.26
+++ client/gui-mui/worklistclass.c      29 Nov 2004 21:50:03 -0000
@@ -109,7 +109,7 @@
   {
     if (game.global_wonders[id])
       return _("Built");
-    if (wonder_obsolete(id))
+    if (improvement_obsolete(NULL, id))
       return _("Obsolete");
     return _("Wonder");
   }
Index: client/gui-sdl/wldlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/wldlg.c,v
retrieving revision 1.15
diff -u -r1.15 wldlg.c
--- client/gui-sdl/wldlg.c      20 Nov 2004 21:27:18 -0000      1.15
+++ client/gui-sdl/wldlg.c      29 Nov 2004 21:50:03 -0000
@@ -1416,7 +1416,7 @@
       SDL_SetAlpha(pText_Name, 0x0, 0x0);
   
       if (is_wonder(imp)) {
-        if (wonder_obsolete(imp)) {
+        if (improvement_obsolete(NULL, imp)) {
           state = _("Obsolete");
         } else {
           if (game.global_wonders[imp] != 0) {
Index: common/improvement.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/improvement.c,v
retrieving revision 1.48
diff -u -r1.48 improvement.c
--- common/improvement.c        29 Sep 2004 02:24:22 -0000      1.48
+++ common/improvement.c        29 Nov 2004 21:50:03 -0000
@@ -336,14 +336,6 @@
 }
 
 /**************************************************************************
-...
-**************************************************************************/
-bool wonder_obsolete(Impr_Type_id id)
-{
-  return improvement_obsolete(NULL, id);
-}
-
-/**************************************************************************
  Clears a list of improvements - sets them all to I_NONE
 **************************************************************************/
 void improvement_status_init(Impr_Status * improvements, size_t elements)
Index: common/improvement.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/improvement.h,v
retrieving revision 1.35
diff -u -r1.35 improvement.h
--- common/improvement.h        10 Nov 2004 17:01:59 -0000      1.35
+++ common/improvement.h        29 Nov 2004 21:50:03 -0000
@@ -104,7 +104,6 @@
 bool improvement_obsolete(const struct player *pplayer, Impr_Type_id id);
 bool improvement_redundant(struct player *pplayer, const struct city *pcity,
                           Impr_Type_id id, bool want_to_build);
-bool wonder_obsolete(Impr_Type_id id);
 Impr_Type_id find_improvement_by_name(const char *s);
 Impr_Type_id find_improvement_by_name_orig(const char *s);
 void improvement_status_init(Impr_Status * improvements, size_t elements);
Index: common/aicore/aisupport.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/aicore/aisupport.c,v
retrieving revision 1.5
diff -u -r1.5 aisupport.c
--- common/aicore/aisupport.c   29 Sep 2004 02:24:23 -0000      1.5
+++ common/aicore/aisupport.c   29 Nov 2004 21:50:03 -0000
@@ -116,7 +116,8 @@
     }
   } unit_list_iterate_end;
   built_impr_iterate(pcity, impr) {
-    if (improvement_types[impr].is_wonder && !wonder_obsolete(impr)) {
+    if (improvement_types[impr].is_wonder
+       && !improvement_obsolete(NULL, impr)) {
       worth += impr_sell_gold(impr);
    } else {
       worth += impr_sell_gold(impr) / 4;

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11257) replace wonder_obsolete, Jason Short <=