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

On 03/08/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
> On 05/03/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
> >
> >  This makes built time property of base type.
>
>  Updated against svn

 Again only updated so that it applies and compiles. This requires
complete retesting to make sure that it still works after all these
small updates.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/packhand.c freeciv/client/packhand.c
--- freeciv/client/packhand.c	2007-08-05 17:26:44.000000000 +0300
+++ freeciv/client/packhand.c	2007-08-05 17:54:41.000000000 +0300
@@ -2467,8 +2467,6 @@
   pterrain->transform_result = terrain_by_number(p->transform_result);
   pterrain->transform_time = p->transform_time;
   pterrain->rail_time = p->rail_time;
-  pterrain->airbase_time = p->airbase_time;
-  pterrain->fortress_time = p->fortress_time;
   pterrain->clean_pollution_time = p->clean_pollution_time;
   pterrain->clean_fallout_time = p->clean_fallout_time;
   
@@ -2535,6 +2533,8 @@
 
   pbase->gui_type = p->gui_type;
 
+  pbase->build_time = p->build_time;
+
   pbase->flags = p->flags;
 
   tileset_setup_base(tileset, pbase);
diff -Nurd -X.diff_ignore freeciv/common/base.h freeciv/common/base.h
--- freeciv/common/base.h	2007-08-05 17:26:44.000000000 +0300
+++ freeciv/common/base.h	2007-08-05 17:55:40.000000000 +0300
@@ -53,6 +53,7 @@
   char activity_gfx[MAX_LEN_NAME];
   struct requirement_vector reqs;
   enum base_gui_type gui_type;
+  int build_time;
 
   bv_unit_classes native_to;
   bv_base_flags flags;
diff -Nurd -X.diff_ignore freeciv/common/packets.def freeciv/common/packets.def
--- freeciv/common/packets.def	2007-08-03 22:14:13.000000000 +0300
+++ freeciv/common/packets.def	2007-08-05 17:54:41.000000000 +0300
@@ -1264,8 +1264,6 @@
   TERRAIN transform_result;
   UINT8 transform_time;
   UINT8 rail_time;
-  UINT8 airbase_time;
-  UINT8 fortress_time;
   UINT8 clean_pollution_time;
   UINT8 clean_fallout_time;
   
@@ -1292,6 +1290,7 @@
   REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
   BASE_GUI gui_type;
   BV_UNIT_CLASSES native_to;
+  UINT8 build_time;
   BV_BASE_FLAGS flags;
 end
 
diff -Nurd -X.diff_ignore freeciv/common/terrain.h freeciv/common/terrain.h
--- freeciv/common/terrain.h	2007-08-03 22:14:13.000000000 +0300
+++ freeciv/common/terrain.h	2007-08-05 17:54:41.000000000 +0300
@@ -175,8 +175,6 @@
   struct terrain *transform_result;
   int transform_time;
   int rail_time;
-  int airbase_time;
-  int fortress_time;
   int clean_pollution_time;
   int clean_fallout_time;
 
diff -Nurd -X.diff_ignore freeciv/common/tile.c freeciv/common/tile.c
--- freeciv/common/tile.c	2007-08-05 17:26:44.000000000 +0300
+++ freeciv/common/tile.c	2007-08-05 18:08:03.000000000 +0300
@@ -319,9 +319,9 @@
                             enum base_type_id base)
 {
   if (base == BASE_AIRBASE) {
-    return ptile->terrain->fortress_time * ACTIVITY_FACTOR;
+    return base_by_number(BASE_AIRBASE)->build_time * ACTIVITY_FACTOR;
   } else {
-    return ptile->terrain->airbase_time * ACTIVITY_FACTOR;
+    return base_by_number(BASE_FORTRESS)->build_time * ACTIVITY_FACTOR;
   }
 
   return 0;
diff -Nurd -X.diff_ignore freeciv/data/civ1/terrain.ruleset freeciv/data/civ1/terrain.ruleset
--- freeciv/data/civ1/terrain.ruleset	2007-08-03 22:13:41.000000000 +0300
+++ freeciv/data/civ1/terrain.ruleset	2007-08-05 17:54:41.000000000 +0300
@@ -909,6 +909,7 @@
 ; reqs 	                  = requirements to build the base (see effects.ruleset
 ;                           and README.effects for help on requirements)
 ; gui_type                = How gui should handle this base. Fortress/Airbase/Other
+; build_time              = How long it takes for a unit to build this base
 ; flags
 ;   - "NoAggressive"      = Units inside are not considered aggressive
 ;   - "DefenseBonus"      = Units inside gain defense bonus
@@ -929,6 +930,7 @@
       "UnitFlag", "Settlers", "Local"
     }
 gui_type     = "Fortress"
+build_time   = 3
 native_to    = "Land"
 flags        = "NoAggressive", "DefenseBonus", "ClaimTerritory",
                "NoStackDeath", "DiplomatDefense"
@@ -943,5 +945,6 @@
       "Tech", "Never", "Player"
     }
 gui_type     = "Airbase"
+build_time   = 3
 native_to    = "Air", "Missile"
 flags        = "NoStackDeath", "DiplomatDefense", "ParadropFrom"
diff -Nurd -X.diff_ignore freeciv/data/civ2/terrain.ruleset freeciv/data/civ2/terrain.ruleset
--- freeciv/data/civ2/terrain.ruleset	2007-08-03 22:13:41.000000000 +0300
+++ freeciv/data/civ2/terrain.ruleset	2007-08-05 17:54:41.000000000 +0300
@@ -1000,6 +1000,7 @@
 ; reqs 	                  = requirements to build the base (see effects.ruleset
 ;                           and README.effects for help on requirements)
 ; gui_type                = How gui should handle this base. Fortress/Airbase/Other
+; build_time              = How long it takes for a unit to build this base
 ; flags
 ;   - "NoAggressive"      = Units inside are not considered aggressive
 ;   - "DefenseBonus"      = Units inside gain defense bonus
@@ -1020,6 +1021,7 @@
       "UnitFlag", "Settlers", "Local"
     }
 gui_type     = "Fortress"
+build_time   = 3
 native_to    = "Land"
 flags        = "NoAggressive", "DefenseBonus", "ClaimTerritory",
                "NoStackDeath", "DiplomatDefense"
@@ -1036,5 +1038,6 @@
       "UnitFlag", "Airbase", "Local"
     }
 gui_type     = "Airbase"
+build_time   = 3
 native_to    = "Air", "Helicopter", "Missile"
 flags        = "NoStackDeath", "DiplomatDefense", "ParadropFrom"
diff -Nurd -X.diff_ignore freeciv/data/default/terrain.ruleset freeciv/data/default/terrain.ruleset
--- freeciv/data/default/terrain.ruleset	2007-08-03 22:13:41.000000000 +0300
+++ freeciv/data/default/terrain.ruleset	2007-08-05 17:54:41.000000000 +0300
@@ -204,8 +204,6 @@
 transform_result     = "Swamp"
 transform_time       = 36
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -244,8 +242,6 @@
 transform_result     = "Swamp"
 transform_time       = 36
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -284,8 +280,6 @@
 transform_result     = "Swamp"
 transform_time       = 36
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -324,8 +318,6 @@
 transform_result     = "Swamp"
 transform_time       = 36
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -364,8 +356,6 @@
 transform_result     = "no"
 transform_time       = 0
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -404,8 +394,6 @@
 transform_result     = "no"
 transform_time       = 0
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -444,8 +432,6 @@
 transform_result     = "no"
 transform_time       = 0
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -484,8 +470,6 @@
 transform_result     = "no"
 transform_time       = 0
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -524,8 +508,6 @@
 transform_result     = "no"
 transform_time       = 0
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -564,8 +546,6 @@
 transform_result     = "Tundra"
 transform_time       = 24
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -603,8 +583,6 @@
 transform_result     = "Plains"
 transform_time       = 24
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "Swamp"
@@ -642,8 +620,6 @@
 transform_result     = "Grassland"
 transform_time       = 24
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "Jungle"
@@ -681,8 +657,6 @@
 transform_result     = "Hills"
 transform_time       = 24
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "Swamp"
@@ -719,8 +693,6 @@
 transform_result     = "Plains"
 transform_time       = 24
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -758,8 +730,6 @@
 transform_result     = "Plains"
 transform_time       = 24
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -798,8 +768,6 @@
 transform_result     = "Hills"
 transform_time       = 24
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -836,8 +804,6 @@
 transform_result     = "Grassland"
 transform_time       = 24
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "Swamp"
@@ -875,8 +841,6 @@
 transform_result     = "Ocean"
 transform_time       = 36
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -914,8 +878,6 @@
 transform_result     = "Desert"
 transform_time       = 24
 rail_time            = 3
-airbase_time         = 3
-fortress_time        = 3
 clean_pollution_time = 3
 clean_fallout_time   = 3
 warmer_wetter_result = "no"
@@ -1088,6 +1050,7 @@
 ; reqs 	                  = requirements to build the base (see effects.ruleset
 ;                           and README.effects for help on requirements)
 ; gui_type                = How gui should handle this base. Fortress/Airbase/Other
+; build_time              = How long it takes for a unit to build this base
 ; flags
 ;   - "NoAggressive"      = Units inside are not considered aggressive
 ;   - "DefenseBonus"      = Units inside gain defense bonus
@@ -1108,6 +1071,7 @@
       "UnitFlag", "Settlers", "Local"
     }
 gui_type     = "Fortress"
+build_time   = 3
 native_to    = "Land"
 flags        = "NoAggressive", "DefenseBonus", "ClaimTerritory",
                "NoStackDeath", "DiplomatDefense"
@@ -1124,5 +1088,6 @@
       "UnitFlag", "Airbase", "Local"
     }
 gui_type     = "Airbase"
+build_time   = 3
 native_to    = "Air", "Helicopter", "Missile"
 flags        = "NoStackDeath", "DiplomatDefense", "ParadropFrom"
diff -Nurd -X.diff_ignore freeciv/manual/civmanual.c freeciv/manual/civmanual.c
--- freeciv/manual/civmanual.c	2007-08-03 22:14:15.000000000 +0300
+++ freeciv/manual/civmanual.c	2007-08-05 17:54:41.000000000 +0300
@@ -222,8 +222,8 @@
       fprintf(doc, "<th>%s<br/>%s</th>", _("Move cost"), _("Defense bonus"));
       fprintf(doc, "<th>%s<br/>%s<br/>%s<br/>%s<br/>(%s)</th>",
               _("Irrigation"), _("Mining"), _("Road"), _("Transform"), _("turns"));
-      fprintf(doc, "<th>%s<br/>%s<br/>%s<br/>%s<br/>%s</th></tr>\n\n",
-              _("Airbase"), _("Fortress"), _("Rail"),
+      fprintf(doc, "<th>%s<br/>%s<br/>%s</th></tr>\n\n",
+              _("Rail"),
               _("Clean pollution"), _("Clean fallout"));
       terrain_type_iterate(pterrain) {
         struct resource **r;
@@ -281,8 +281,8 @@
                 terrain_name_translation(pterrain->transform_result),
                 pterrain->transform_time);
 
-        fprintf(doc, "<td align=\"center\">%d / %d / %d / %d / %d</td></tr>\n\n",
-                pterrain->airbase_time, pterrain->fortress_time, pterrain->rail_time,
+        fprintf(doc, "<td align=\"center\">%d / %d / %d</td></tr>\n\n",
+                pterrain->rail_time,
                 pterrain->clean_pollution_time, pterrain->clean_fallout_time);
       } terrain_type_iterate_end;
       fprintf(doc, "</table>\n");
diff -Nurd -X.diff_ignore freeciv/server/ruleset.c freeciv/server/ruleset.c
--- freeciv/server/ruleset.c	2007-08-05 17:26:41.000000000 +0300
+++ freeciv/server/ruleset.c	2007-08-05 17:54:41.000000000 +0300
@@ -1779,10 +1779,6 @@
       = secfile_lookup_int(file, "%s.transform_time", tsec[i]);
     pterrain->rail_time
       = secfile_lookup_int_default(file, 3, "%s.rail_time", tsec[i]);
-    pterrain->airbase_time
-      = secfile_lookup_int_default(file, 3, "%s.airbase_time", tsec[i]);
-    pterrain->fortress_time
-      = secfile_lookup_int_default(file, 3, "%s.fortress_time", tsec[i]);
     pterrain->clean_pollution_time
       = secfile_lookup_int_default(file, 3, "%s.clean_pollution_time", tsec[i]);
     pterrain->clean_fallout_time
@@ -1963,6 +1959,8 @@
       exit(EXIT_FAILURE);
     }
 
+    pbase->build_time = secfile_lookup_int(file, "%s.build_time", section);
+
     slist = secfile_lookup_str_vec(file, &nval, "%s.flags", section);
     BV_CLR_ALL(pbase->flags);
     for (j = 0; j < nval; j++) {
@@ -3244,8 +3242,6 @@
 			       : -1);
     packet.transform_time = pterrain->transform_time;
     packet.rail_time = pterrain->rail_time;
-    packet.airbase_time = pterrain->airbase_time;
-    packet.fortress_time = pterrain->fortress_time;
     packet.clean_pollution_time = pterrain->clean_pollution_time;
     packet.clean_fallout_time = pterrain->clean_fallout_time;
 
diff -Nurd -X.diff_ignore freeciv/version.in freeciv/version.in
--- freeciv/version.in	2007-08-03 22:14:26.000000000 +0300
+++ freeciv/version.in	2007-08-05 18:16:56.000000000 +0300
@@ -24,4 +24,4 @@
 #   - Avoid adding a new mandatory capbility to the development branch for
 #     as long as possible.  We want to maintain network compatibility with
 #     the stable branch for as long as possible.
-FREECIV_NETWORK_CAPSTRING(["+Freeciv.Devel.2007.Mar.27"])
+FREECIV_NETWORK_CAPSTRING(["+Freeciv.Devel.2007.Aug.05"])
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to