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

 This makes built time property of base type.

 This loses some flexibility as previously every terrain type defined
fortress and airbase build times independently. However, it's unlikely
that anybody has ever used different build times for different
terrains.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/packhand.c freeciv/client/packhand.c
--- freeciv/client/packhand.c	2007-03-04 18:03:59.000000000 +0200
+++ freeciv/client/packhand.c	2007-03-05 05:27:44.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;
   
@@ -2479,6 +2477,8 @@
   }
   assert(pbase->reqs.size == p->reqs_count);
 
+  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-05 00:51:27.000000000 +0200
+++ freeciv/common/base.h	2007-03-05 05:23:06.000000000 +0200
@@ -43,6 +43,7 @@
   char name_orig[MAX_LEN_NAME];
   int id;
   struct requirement_vector reqs;
+  int build_time;
   bv_base_flags flags;
 };
 
diff -Nurd -X.diff_ignore freeciv/common/packets.def freeciv/common/packets.def
--- freeciv/common/packets.def	2007-03-03 23:02:08.000000000 +0200
+++ freeciv/common/packets.def	2007-03-05 05:27:13.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_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-05 05:26:24.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-02-28 23:02:38.000000000 +0200
+++ freeciv/common/tile.c	2007-03-05 05:30:54.000000000 +0200
@@ -253,13 +253,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/default/terrain.ruleset freeciv/data/default/terrain.ruleset
--- freeciv/data/default/terrain.ruleset	2007-03-04 22:55:02.000000000 +0200
+++ freeciv/data/default/terrain.ruleset	2007-03-05 05:23:51.000000000 +0200
@@ -777,6 +777,7 @@
       "Tech", "Construction", "Player"
       "TerrainClass", "Land", "Local"
     }
+build_time  = 3
 flags       = "NoAggressive", "DefenseBonus", "Watchtower", "ClaimTerritory",
               "NoStackDeath", "DiplomatDefense"
 
@@ -787,5 +788,6 @@
       "Tech", "Radio", "Player"
       "TerrainClass", "Land", "Local"
     }
+build_time  = 3
 flags       = "NoStackDeath", "DiplomatDefense", "Refuel", "NoHPLoss",
               "AttackUnreachable", "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-05 05:34:55.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-04 16:55:04.000000000 +0200
+++ freeciv/server/ruleset.c	2007-03-05 05:28:17.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
@@ -1804,6 +1800,8 @@
     reqs = lookup_req_list(file, section, "reqs");
     requirement_vector_copy(&pbase->reqs, reqs);
 
+    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++) {
@@ -3007,8 +3005,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-03 23:02:09.000000000 +0200
+++ freeciv/version.in	2007-03-05 05:26:46.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.03")
+FREECIV_NETWORK_CAPSTRING("+Freeciv.Devel.2007.Mar.05")
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to