Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9827) remove T_MOUNTAINS reference
Home

[Freeciv-Dev] (PR#9827) remove T_MOUNTAINS reference

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9827) remove T_MOUNTAINS reference
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 26 Aug 2004 15:34:55 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9827 >

This patch removes a reference to T_MOUNTAINS in settlers.c.  AFAIK this 
is the only remaining terrain reference outside of mapgen.

Behavior should be unchanged by this patch.  But don't ask why this code 
is written the way it is.  This is the AI connect code which we planned 
to rewrite.

jason

Index: server/settlers.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/settlers.c,v
retrieving revision 1.197
diff -u -r1.197 settlers.c
--- server/settlers.c   25 Aug 2004 18:24:21 -0000      1.197
+++ server/settlers.c   26 Aug 2004 22:32:01 -0000
@@ -562,7 +562,6 @@
   bool has_road[12], is_slow[12];
   int dx[12] = {-1,  0,  1, -1, 1, -1, 0, 1,  0, -2, 2, 0};
   int dy[12] = {-1, -1, -1,  0, 0,  1, 1, 1, -2,  0, 0, 2};
-  struct tile *ptile;
   bool is_border = IS_BORDER_MAP_POS(map_x, map_y, 2);
   
   assert(special == S_ROAD || special == S_RAILROAD);
@@ -578,13 +577,15 @@
       has_road[i] = FALSE;
       is_slow[i] = FALSE; /* FIXME: should be TRUE? */
     } else {
-      ptile = map_get_tile(x1, y1);
+      struct tile *ptile = map_get_tile(x1, y1);
+      struct tile_type *ptype = get_tile_type(ptile->terrain);
+
       has_road[i] = tile_has_special(ptile, special);
 
       /* If TRUE, this value indicates that this tile does not need
-       * a road connector.  FIXME: this shouldn't include mountains. */
-      is_slow[i] = (ptile->terrain == T_MOUNTAINS
-                   || is_ocean(ptile->terrain));
+       * a road connector.  This is set for terrains which cannot have
+       * road or where road takes "too long" to build. */
+      is_slow[i] = (ptype->road_time == 0 || ptype->road_time > 5);
 
       if (!has_road[i]) {
        unit_list_iterate(ptile->units, punit) {

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#9827) remove T_MOUNTAINS reference, Jason Short <=