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

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


 - ML

diff -Nurd -X.diff_ignore freeciv/client/packhand.c freeciv/client/packhand.c
--- freeciv/client/packhand.c	2007-03-06 03:31:58.000000000 +0200
+++ freeciv/client/packhand.c	2007-03-06 03:45:35.000000000 +0200
@@ -2414,8 +2414,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;
   
@@ -2481,6 +2479,8 @@
 
   pbase->native_to = p->native_to;
 
+  pbase->build_time = p->build_time;
+
   pbase->flags = p->flags;
 }
 
diff -Nurd -X.diff_ignore freeciv/common/base.h freeciv/common/base.h
--- freeciv/common/base.h	2007-03-06 03:31:58.000000000 +0200
+++ freeciv/common/base.h	2007-03-06 03:46:29.000000000 +0200
@@ -39,6 +39,7 @@
   char name_orig[MAX_LEN_NAME];
   int id;
   struct requirement_vector reqs;
+  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-06 03:31:58.000000000 +0200
+++ freeciv/common/packets.def	2007-03-06 03:47:22.000000000 +0200
@@ -1250,8 +1250,6 @@
   TERRAIN transform_result;
   UINT8 transform_time;
   UINT8 rail_time;
-  UINT8 airbase_time;
-  UINT8 fortress_time;
   UINT8 clean_pollution_time;
   UINT8 clean_fallout_time;
   
@@ -1272,6 +1270,7 @@
   STRING name[MAX_LEN_NAME];
   UINT8 reqs_count;
   REQUIREMENT reqs[MAX_NUM_REQS:reqs_count];
+  UINT8 build_time;
   BV_UNIT_CLASSES native_to;
   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-06 03:45:35.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-06 03:45:35.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-06 03:31:56.000000000 +0200
+++ freeciv/data/civ1/terrain.ruleset	2007-03-06 03:50:17.000000000 +0200
@@ -614,6 +614,7 @@
       "Tech", "Construction", "Player"
       "TerrainClass", "Land", "Local"
     }
+build_time  = 3
 native_to   = "Land"
 flags       = "NoAggressive", "DefenseBonus", "ClaimTerritory",
               "NoStackDeath", "DiplomatDefense"
@@ -624,5 +625,6 @@
     { "type", "name", "range"
       "Tech", "Never", "Player"
     }
+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-06 03:31:57.000000000 +0200
+++ freeciv/data/civ2/terrain.ruleset	2007-03-06 03:48:58.000000000 +0200
@@ -706,6 +706,7 @@
       "Tech", "Construction", "Player"
       "TerrainClass", "Land", "Local"
     }
+build_time  = 3
 native_to   = "Land"
 flags       = "NoAggressive", "DefenseBonus", "ClaimTerritory",
               "NoStackDeath", "DiplomatDefense"
@@ -717,5 +718,6 @@
       "Tech", "Radio", "Player"
       "TerrainClass", "Land", "Local"
     }
+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-06 03:31:57.000000000 +0200
+++ freeciv/data/default/terrain.ruleset	2007-03-06 03:48:08.000000000 +0200
@@ -773,6 +773,7 @@
       "Tech", "Construction", "Player"
       "TerrainClass", "Land", "Local"
     }
+build_time  = 3
 native_to   = "Land"
 flags       = "NoAggressive", "DefenseBonus", "ClaimTerritory",
               "NoStackDeath", "DiplomatDefense"
@@ -784,5 +785,6 @@
       "Tech", "Radio", "Player"
       "TerrainClass", "Land", "Local"
     }
+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-06 03:45:35.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-06 03:31:56.000000000 +0200
+++ freeciv/server/ruleset.c	2007-03-06 03:45:35.000000000 +0200
@@ -1671,10 +1671,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
@@ -1820,6 +1816,8 @@
     }
     free(slist);
 
+    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++) {
@@ -3023,8 +3021,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-06 03:31:58.000000000 +0200
+++ freeciv/version.in	2007-03-06 03:45:53.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.06")
+FREECIV_NETWORK_CAPSTRING("+Freeciv.Devel.2007.Mar.06-2")
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to