Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11559) remove rtech values entirely
Home

[Freeciv-Dev] (PR#11559) remove rtech values entirely

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11559) remove rtech values entirely
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 16 Dec 2004 15:32:16 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11559 >

This patch removes the rtech building values entirely.  It includes the 
helptext patch, plus a rather ugly change to plrhand.c, plus simply 
removing the values.

jason

Index: client/helpdata.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/helpdata.c,v
retrieving revision 1.90
diff -u -r1.90 helpdata.c
--- client/helpdata.c   8 Dec 2004 20:48:33 -0000       1.90
+++ client/helpdata.c   16 Dec 2004 23:31:16 -0000
@@ -1038,14 +1038,6 @@
   if (tech_flag(i, TF_POPULATION_POLLUTION_INC))
     sprintf(buf + strlen(buf), _("* Increases the pollution generated by "
                                 "the population.\n"));
-  if (game.rtech.cathedral_plus == i)
-    sprintf(buf + strlen(buf), _("* Improves the effect of Cathedrals.\n"));
-  if (game.rtech.cathedral_minus == i)
-    sprintf(buf + strlen(buf), _("* Reduces the effect of Cathedrals.\n"));
-  if (game.rtech.colosseum_plus == i)
-    sprintf(buf + strlen(buf), _("* Improves the effect of Colosseums.\n"));
-  if (game.rtech.temple_plus == i)
-    sprintf(buf + strlen(buf), _("* Improves the effect of Temples.\n"));
 
   if (tech_flag(i, TF_BRIDGE)) {
     const char *units_str = get_units_with_flag_string(F_SETTLERS);
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.450
diff -u -r1.450 packhand.c
--- client/packhand.c   16 Dec 2004 20:37:48 -0000      1.450
+++ client/packhand.c   16 Dec 2004 23:31:18 -0000
@@ -2113,11 +2113,6 @@
   game.notradesize = packet->notradesize;
   game.fulltradesize = packet->fulltradesize;
   
-  game.rtech.cathedral_plus = packet->rtech_cathedral_plus;
-  game.rtech.cathedral_minus = packet->rtech_cathedral_minus;
-  game.rtech.colosseum_plus = packet->rtech_colosseum_plus;
-  game.rtech.temple_plus = packet->rtech_temple_plus;
-
   for(i=0; i<MAX_NUM_TECH_LIST; i++) {
     game.rtech.partisan_req[i]  = packet->rtech_partisan_req[i];
     freelog(LOG_DEBUG, "techl %d: %d", i, game.rtech.partisan_req[i]);
Index: common/game.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.h,v
retrieving revision 1.165
diff -u -r1.165 game.h
--- common/game.h       16 Dec 2004 20:37:49 -0000      1.165
+++ common/game.h       16 Dec 2004 23:31:18 -0000
@@ -174,10 +174,6 @@
   Impr_Type_id land_defend_building;
 
   struct {
-    int cathedral_plus;                /* eg Theology */
-    int cathedral_minus;       /* eg Communism */
-    int colosseum_plus;                /* eg Electricity */
-    int temple_plus;           /* eg Mysticism */
     int nav;                   /* AI convenience: tech_req for first
                                   non-trireme ferryboat */
     int u_partisan;            /* convenience: tech_req for first
Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.79
diff -u -r1.79 packets.def
--- common/packets.def  16 Dec 2004 20:37:49 -0000      1.79
+++ common/packets.def  16 Dec 2004 23:31:18 -0000
@@ -1197,10 +1197,6 @@
   UINT8 num_unit_types;
   UINT8 num_impr_types;
   UINT8 num_tech_types;
-  UINT8 rtech_cathedral_plus;
-  UINT8 rtech_cathedral_minus;
-  UINT8 rtech_colosseum_plus;
-  UINT8 rtech_temple_plus;
   TECH_LIST rtech_partisan_req[MAX_NUM_TECH_LIST]; 
   UINT8 government_when_anarchy;
   UINT8 default_government;
Index: data/civ1/techs.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/civ1/techs.ruleset,v
retrieving revision 1.16
diff -u -r1.16 techs.ruleset
--- data/civ1/techs.ruleset     29 Nov 2004 22:22:24 -0000      1.16
+++ data/civ1/techs.ruleset     16 Dec 2004 23:31:18 -0000
@@ -373,6 +373,7 @@
 req1     = "Ceremonial Burial"
 req2     = "None"
 flags    = ""
+helptext = _("Improves the effect of Temples.")
 
 [advance_navigation]
 name     = _("Navigation")
Index: data/civ2/techs.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/civ2/techs.ruleset,v
retrieving revision 1.18
diff -u -r1.18 techs.ruleset
--- data/civ2/techs.ruleset     29 Nov 2004 22:22:25 -0000      1.18
+++ data/civ2/techs.ruleset     16 Dec 2004 23:31:18 -0000
@@ -133,6 +133,7 @@
 req1     = "Philosophy"
 req2     = "Industrialization"
 flags    = ""
+helptext = _("Reduces the effect of Cathedrals.")
 
 [advance_computers]
 name     = _("Computers")
@@ -175,6 +176,7 @@
 req1     = "Metallurgy"
 req2     = "Magnetism"
 flags    = ""
+helptext = _("Improves the effect of Colosseums.")
 
 [advance_electronics]
 name     = _("Electronics")
@@ -373,6 +375,7 @@
 req1     = "Ceremonial Burial"
 req2     = "None"
 flags    = ""
+helptext = _("Improves the effect of Temples.")
 
 [advance_navigation]
 name     = _("Navigation")
@@ -535,6 +538,7 @@
 req1     = "Feudalism"
 req2     = "Monotheism"
 flags    = ""
+helptext = _("Improves the effect of Cathedrals.")
 
 [advance_theory_of_gravity]
 name     = _("Theory of Gravity")
Index: data/default/techs.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/default/techs.ruleset,v
retrieving revision 1.24
diff -u -r1.24 techs.ruleset
--- data/default/techs.ruleset  29 Nov 2004 22:22:25 -0000      1.24
+++ data/default/techs.ruleset  16 Dec 2004 23:31:19 -0000
@@ -182,6 +182,7 @@
 flags    = ""
 graphic     = "a.communism"
 graphic_alt = "-"
+helptext = _("Reduces the effect of Cathedrals.")
 
 [advance_computers]
 name     = _("Computers")
@@ -238,6 +239,7 @@
 flags    = ""
 graphic     = "a.electricity"
 graphic_alt = "-"
+helptext = _("Improves the effect of Colosseums.")
 
 [advance_electronics]
 name     = _("Electronics")
@@ -502,6 +504,7 @@
 flags    = ""
 graphic     = "a.mysticism"
 graphic_alt = "-"
+helptext = _("Improves the effect of Temples.")
 
 [advance_navigation]
 name     = _("Navigation")
@@ -720,6 +723,7 @@
 flags    = ""
 graphic     = "a.theology"
 graphic_alt = "-"
+helptext = _("Improves the effect of Cathedrals.")
 
 [advance_theory_of_gravity]
 name     = _("Theory of Gravity")
Index: data/history/techs.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/history/techs.ruleset,v
retrieving revision 1.4
diff -u -r1.4 techs.ruleset
--- data/history/techs.ruleset  29 Nov 2004 22:22:26 -0000      1.4
+++ data/history/techs.ruleset  16 Dec 2004 23:31:19 -0000
@@ -133,6 +133,7 @@
 req1     = "Philosophy"
 req2     = "Industrialization"
 flags    = ""
+helptext = _("Reduces the effect of Cathedrals.")
 
 [advance_computers]
 name     = _("Computers")
@@ -175,6 +176,7 @@
 req1     = "Metallurgy"
 req2     = "Industrialization"
 flags    = ""
+helptext = _("Improves the effect of Colosseums.")
 
 [advance_electronics]
 name     = _("Electronics")
@@ -373,6 +375,7 @@
 req1     = "Ceremonial Burial"
 req2     = "None"
 flags    = ""
+helptext = _("Improves the effect of Temples.")
 
 [advance_navigation]
 name     = _("Navigation")
@@ -537,6 +540,7 @@
 req1     = "Feudalism"
 req2     = "Monotheism"
 flags    = ""
+helptext = _("Improves the effect of Cathedrals.")
 
 [advance_theory_of_gravity]
 name     = _("Theory of Gravity")
Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.345
diff -u -r1.345 plrhand.c
--- server/plrhand.c    16 Dec 2004 00:37:41 -0000      1.345
+++ server/plrhand.c    16 Dec 2004 23:31:20 -0000
@@ -420,19 +420,16 @@
    * Inform player about his new tech.
    */
   send_player_info(plr, plr);
-  
+
   /*
-   * Update all cities if the new tech affects happiness.
+   * Update all cities in case the tech changed some effects. This is
+   * inefficient; it could be optimized if it's found to be a problem.  But
+   * techs aren't researched that often.
    */
-  if (tech_found == game.rtech.cathedral_plus
-      || tech_found == game.rtech.cathedral_minus
-      || tech_found == game.rtech.colosseum_plus
-      || tech_found == game.rtech.temple_plus) {
-    city_list_iterate(plr->cities, pcity) {
-      city_refresh(pcity);
-      send_city_info(plr, pcity);
-    } city_list_iterate_end;
-  }
+  cities_iterate(pcity) {
+    city_refresh(pcity);
+    send_city_info(city_owner(pcity), pcity);
+  } cities_iterate_end;
 
   /*
    * Send all player an updated info of the owner of the Marco Polo
Index: server/ruleset.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v
retrieving revision 1.218
diff -u -r1.218 ruleset.c
--- server/ruleset.c    16 Dec 2004 20:37:49 -0000      1.218
+++ server/ruleset.c    16 Dec 2004 23:31:20 -0000
@@ -1469,17 +1469,6 @@
     game.default_building = B_LAST;
   }
 
-  /* FIXME: remove all of the following when gen-impr implemented... */
-
-  game.rtech.cathedral_plus =
-    lookup_tech(file, "b_special", "cathedral_plus", FALSE, filename, NULL);
-  game.rtech.cathedral_minus =
-    lookup_tech(file, "b_special", "cathedral_minus", FALSE, filename, NULL);
-  game.rtech.colosseum_plus =
-    lookup_tech(file, "b_special", "colosseum_plus", FALSE, filename, NULL);
-  game.rtech.temple_plus =
-    lookup_tech(file, "b_special", "temple_plus", FALSE, filename, NULL);
-
   free(sec);
   section_file_check_unused(file, filename);
   section_file_free(file);
@@ -1963,11 +1952,6 @@
   packet.notradesize = game.notradesize;
   packet.fulltradesize = game.fulltradesize;
 
-  packet.rtech_cathedral_plus = game.rtech.cathedral_plus;
-  packet.rtech_cathedral_minus = game.rtech.cathedral_minus;
-  packet.rtech_colosseum_plus = game.rtech.colosseum_plus;
-  packet.rtech_temple_plus = game.rtech.temple_plus;
-
   for(i=0; i<MAX_NUM_TECH_LIST; i++) {
     packet.rtech_partisan_req[i] = game.rtech.partisan_req[i];
   }

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