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

On 3/6/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
>
> On 3/5/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
> >
> >  This makes built time property of base type.
>
>  - Updated against svn
>  - Necessary modifications to civ1 & civ2 rulesets too

 - Updated against svn
 - Removed unused fortress_time and airbase_time definitions from
terrains in rulesets


 - ML

diff -Nurd -X.diff_ignore freeciv/client/packhand.c freeciv/client/packhand.c
--- freeciv/client/packhand.c	2007-03-09 16:14:15.000000000 +0200
+++ freeciv/client/packhand.c	2007-03-11 23:38:22.000000000 +0200
@@ -2415,8 +2415,6 @@
   pterrain->transform_result = get_terrain(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;
   
@@ -2487,6 +2485,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-03-09 16:03:32.000000000 +0200
+++ freeciv/common/base.h	2007-03-11 23:39:13.000000000 +0200
@@ -47,6 +47,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-03-09 16:14:15.000000000 +0200
+++ freeciv/common/packets.def	2007-03-11 23:39:50.000000000 +0200
@@ -1252,8 +1252,6 @@
   TERRAIN transform_result;
   UINT8 transform_time;
   UINT8 rail_time;
-  UINT8 airbase_time;
-  UINT8 fortress_time;
   UINT8 clean_pollution_time;
   UINT8 clean_fallout_time;
   
@@ -1280,6 +1278,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-03-03 18:28:05.000000000 +0200
+++ freeciv/common/terrain.h	2007-03-11 23:38:22.000000000 +0200
@@ -144,8 +144,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-03-06 03:31:58.000000000 +0200
+++ freeciv/common/tile.c	2007-03-11 23:38:22.000000000 +0200
@@ -292,13 +292,13 @@
   case ACTIVITY_IRRIGATE:
     return ptile->terrain->irrigation_time * ACTIVITY_FACTOR;
   case ACTIVITY_FORTRESS:
-    return ptile->terrain->fortress_time * ACTIVITY_FACTOR;
+    return base_type_get_by_id(BASE_FORTRESS)->build_time * ACTIVITY_FACTOR;
   case ACTIVITY_RAILROAD:
     return ptile->terrain->rail_time * ACTIVITY_FACTOR;
   case ACTIVITY_TRANSFORM:
     return ptile->terrain->transform_time * ACTIVITY_FACTOR;
   case ACTIVITY_AIRBASE:
-    return ptile->terrain->airbase_time * ACTIVITY_FACTOR;
+    return base_type_get_by_id(BASE_AIRBASE)->build_time * ACTIVITY_FACTOR;
   case ACTIVITY_FALLOUT:
     return ptile->terrain->clean_fallout_time * ACTIVITY_FACTOR;
   default:
diff -Nurd -X.diff_ignore freeciv/data/civ1/terrain.ruleset freeciv/data/civ1/terrain.ruleset
--- freeciv/data/civ1/terrain.ruleset	2007-03-11 19:33:15.000000000 +0200
+++ freeciv/data/civ1/terrain.ruleset	2007-03-11 23:41:58.000000000 +0200
@@ -604,6 +604,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
@@ -624,6 +625,7 @@
       "UnitFlag", "Settlers", "Local"
     }
 gui_type     = "Fortress"
+build_time   = 3
 native_to    = "Land"
 flags        = "NoAggressive", "DefenseBonus", "ClaimTerritory",
                "NoStackDeath", "DiplomatDefense"
@@ -638,5 +640,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-03-10 19:40:14.000000000 +0200
+++ freeciv/data/civ2/terrain.ruleset	2007-03-11 23:42:38.000000000 +0200
@@ -696,6 +696,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
@@ -716,6 +717,7 @@
       "UnitFlag", "Settlers", "Local"
     }
 gui_type     = "Fortress"
+build_time   = 3
 native_to    = "Land"
 flags        = "NoAggressive", "DefenseBonus", "ClaimTerritory",
                "NoStackDeath", "DiplomatDefense"
@@ -732,5 +734,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-03-10 19:40:14.000000000 +0200
+++ freeciv/data/default/terrain.ruleset	2007-03-11 23:45:15.000000000 +0200
@@ -199,8 +199,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"
@@ -238,8 +236,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"
@@ -277,8 +273,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"
@@ -316,8 +310,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"
@@ -354,8 +346,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"
@@ -393,8 +383,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"
@@ -433,8 +421,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"
@@ -471,8 +457,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"
@@ -511,8 +495,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"
@@ -550,8 +532,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"
@@ -589,8 +569,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"
@@ -763,6 +741,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
@@ -783,6 +762,7 @@
       "UnitFlag", "Settlers", "Local"
     }
 gui_type     = "Fortress"
+build_time   = 3
 native_to    = "Land"
 flags        = "NoAggressive", "DefenseBonus", "ClaimTerritory",
                "NoStackDeath", "DiplomatDefense"
@@ -799,5 +779,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	2006-07-17 23:56:47.000000000 +0300
+++ freeciv/manual/civmanual.c	2007-03-11 23:38:22.000000000 +0200
@@ -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) {
         const struct resource **r;
@@ -275,8 +275,8 @@
         fprintf(doc, "<tr><td>%s</td><td align=\"right\">(%d)</td></tr>\n</table></td>\n",
                 get_name(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-03-09 16:14:14.000000000 +0200
+++ freeciv/server/ruleset.c	2007-03-11 23:38:22.000000000 +0200
@@ -1685,10 +1685,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
@@ -1852,6 +1848,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++) {
@@ -3048,8 +3046,6 @@
 			       ? pterrain->transform_result->index : -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-03-09 16:14:15.000000000 +0200
+++ freeciv/version.in	2007-03-11 23:43:00.000000000 +0200
@@ -24,4 +24,4 @@
 #   - Avoid adding a new manditory 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.09-2")
+FREECIV_NETWORK_CAPSTRING("+Freeciv.Devel.2007.Mar.11")
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to