Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] Re: (PR#7259) new function tile_has_river
Home

[Freeciv-Dev] Re: (PR#7259) new function tile_has_river

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7259) new function tile_has_river
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 18 Jan 2004 03:55:03 -0800
Reply-to: rt@xxxxxxxxxxx

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

On Sat, 17 Jan 2004, Jason Short wrote:
> On that note, what is the purpose of T_RIVER? The impression I get is
> that this is just used for civ1 compatability. But this could easily be
> accomplished just by restricting S_RIVER to grassland tiles (if that
> level of compatability is even desired).

This was discussed two and a half years ago off-list. It started when I
made this patch:

Index: server/savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.78
diff -u -r1.78 savegame.c
--- server/savegame.c   2002/05/21 03:01:33     1.78
+++ server/savegame.c   2002/06/01 22:12:21
@@ -194,6 +194,11 @@
 {
   char *pch = strchr(terrain_chars, ch);

+  if (pch && ch == 'r') {
+    /* Convert old pre-1.9.0 savegames with old style rivers
+       to grasslands. We add rivers later. */
+    pch = strchr(terrain_chars, 'g');
+  }
   if (!pch || ch == '\0') {
     freelog(LOG_FATAL, "Unknown terrain type: '%c' %d", ch, ch);
     exit(EXIT_FAILURE);
@@ -302,6 +307,11 @@
   LOAD_MAP_DATA(secfile_lookup_str(file, "map.t%03d", y),
                map_get_tile(x, y)->terrain = char2terrain(ch));

+  /* Kludge to support pre-1.9.0 savegames with river tiles */
+  LOAD_MAP_DATA(secfile_lookup_str_default(file, NULL, "map.t%03d", y),
+               if (ch == 'r') { map_get_tile(x, y)->special |=
+                                 S_RIVER; } );
+  map.have_rivers_overlay = TRUE;
   assign_continent_numbers();
 }

There were a two problems with this:
 - civ1 ruleset uses riverstyle 1, which makes mapgen produce T_RIVER
instead of S_RIVER. This should also be changed.
 - T_RIVER is handled different by settlers, IIRC: different rules for
transform terrain and building roads/irrigation on it takes a different
amount of time than on S_RIVER and plains.

I think the latter point is a too minor point of civ1 compatibility to
bother with, but if we really want to (I don't) we could generalize these
exceptions with new ruleset options.

  - Per




[Prev in Thread] Current Thread [Next in Thread]