Re: [Freeciv-Dev] (PR#39441) tracking release 2.0.10

2007-07-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39441 

Ulrik Sverdrup wrote:
 But, the content of the ticket I linked to is about changing S2_0 to
 read 2.1 savegames better. So it is (was?) a bug for 2.0.x, invalid or
 not.
 
URL: http://bugs.freeciv.org/Ticket/Display.html?id=19044 

Then the subject is wrong.  I've fixed it.

However, it's not worth doing.  I doubt anybody is interested in playing
2.1 games on 2.0 with no resources.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39441) tracking release 2.0.10

2007-07-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39441 

Mike Kaufman wrote:
  Retrofitting previous versions is pointless I agree.
 
 Indeed, 2.1 doesn't save map.l lines, so 2.0 will exit with error.
 
 I've had my head in the sand for the past year or so I grant, but this was
 necessary for what reason?
 
No idea.

But 2.2 will definitely not be readable by 2.1 or 2.0, as it will have
lots of new civ3 terrain and resource definitions.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39441) tracking release 2.0.10

2007-07-11 Thread Ulrik Sverdrup

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39441 

Further about savegame compatibility:
In 2.1 we introduced the $..$ delimiter for secfiles for code blocks. 

First it was read-only, but that caused ticket 39442: So I built upon
that in http://bugs.freeciv.org/Ticket/Display.html?id=39442 so that
saves with code blocks are probably not 2.0-compatible anymore. That
change could maybe be backed out for S2_1 of course, making $..$
read-only again.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#13215) AI choice problems in civ1 ruleset

2007-07-11 Thread Ulrik Sverdrup

URL: http://bugs.freeciv.org/Ticket/Display.html?id=13215 

(PR#13215) AI choice problems in civ1 ruleset
(PR#39399) 2.1 Ancients modpack bug

Combined these tickets; both the civ1 and ancients rulesets have a
'simplified' list of alternatives in the early game which gives this
behaviour from the ai.

In civ1 there is no Coinage and in Ancients there is no Coinage or
NonMil or even Workers (the Settlers in Ancients can only found cities).

According to the code error text, this is a bug in the ruleset. But the
documentation does not say that units with unit flags NonMil, Settlers
and possibly others should be available from the start.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39382) civ1 and civ2 rulesets crash, no sea barbarians, bad tech Never

2007-07-11 Thread Ulrik Sverdrup

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39382 

To resolve the last item in this bug, the bad tech Never message for
the civ1 ruleset; trunk requires a req for Airbase that is always false.
Here is a small patch.
(The requirement None is always active, and negated it is never active)
Index: data/civ1/terrain.ruleset
===
--- data/civ1/terrain.ruleset	(revision 13094)
+++ data/civ1/terrain.ruleset	(arbetskopia)
@@ -939,8 +939,8 @@
 graphic_alt  = -
 activity_gfx = unit.airbase
 reqs =
-{ type, name, range
-  Tech, Never, Player
+{ type, name, range, negated
+  None, , , 1
 }
 gui_type = Airbase
 native_to= Air, Missile
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39452) Editor Regenerate Water

2007-07-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39452 

Committed trunk revision 13095.

Index: server/ruleset.c
===
--- server/ruleset.c(revision 13094)
+++ server/ruleset.c(working copy)
@@ -1685,7 +1685,7 @@
   filename, tsec[i]);
   exit(EXIT_FAILURE);
 }
-if (UNKNOWN_TERRAIN_IDENTIFIER == pterrain-identifier) {
+if (TERRAIN_UNKNOWN_IDENTIFIER == pterrain-identifier) {
   freelog(LOG_FATAL, \%s\ [%s] cannot use '%c' as an identifier;
   it is reserved.,
   filename, tsec[i], pterrain-identifier);
Index: server/maphand.c
===
--- server/maphand.c(revision 13094)
+++ server/maphand.c(working copy)
@@ -129,7 +129,6 @@
 **/
 void assign_continent_numbers(void)
 {
-  
   /* Initialize */
   map.num_continents = 0;
   map.num_oceans = 0;
@@ -172,6 +171,164 @@
  map.num_continents, map.num_oceans);
 }
 
+/**
+  Regenerate all oceanic tiles with coasts, lakes, and deeper oceans.
+  Assumes assign_continent_numbers() and recalculate_lake_surrounders()
+  have already been done!
+  FIXME: insufficiently generalized, use terrain property.
+**/
+void map_regenerate_water(void)
+{
+#define DEFAULT_LAKE_SEA_SIZE (4)  /* should be configurable */
+#define DEFAULT_NEAR_COAST (6)
+  struct terrain *lake = terrain_by_identifier(TERRAIN_LAKE_IDENTIFIER);
+  struct terrain *sea = terrain_by_identifier(TERRAIN_SEA_IDENTIFIER);
+  struct terrain *coast = terrain_by_identifier(TERRAIN_COAST_IDENTIFIER);
+  struct terrain *shelf = terrain_by_identifier(TERRAIN_SHELF_IDENTIFIER);
+  struct terrain *floor = terrain_by_identifier(TERRAIN_FLOOR_IDENTIFIER);
+  int shelf_depth = shelf-property[MG_OCEAN_DEPTH];
+  int coast_count = 0;
+  int shelf_count = 0;
+  int floor_count = 0;
+
+  /* coasts, lakes, and seas */
+  whole_map_iterate(ptile) {
+struct terrain *pterrain = tile_get_terrain(ptile);
+Continent_id here = tile_get_continent(ptile);
+
+if (T_UNKNOWN == pterrain) {
+  continue;
+}
+if (!is_ocean(pterrain)) {
+  continue;
+}
+if (0  lake_surrounders[-here]) {
+  if (DEFAULT_LAKE_SEA_SIZE  ocean_sizes[-here]) {
+tile_change_terrain(ptile, lake);
+  } else {
+tile_change_terrain(ptile, sea);
+  }
+  update_tile_knowledge(ptile);
+  continue;
+}
+/* leave any existing deep features in place */
+if (pterrain-property[MG_OCEAN_DEPTH]  shelf_depth) {
+  continue;
+}
+
+/* default to shelf */
+tile_change_terrain(ptile, shelf);
+update_tile_knowledge(ptile);
+shelf_count++;
+
+adjc_iterate(ptile, tile2) {
+  if (T_UNKNOWN == tile2-terrain) {
+continue;
+  }
+  /* glacier not otherwise near land floats */
+  if (TERRAIN_GLACIER_IDENTIFIER == tile2-terrain-identifier) {
+continue;
+  }
+  /* any land makes coast */
+  if (!is_ocean(tile2-terrain)) {
+tile_change_terrain(ptile, coast);
+update_tile_knowledge(ptile);
+coast_count++;
+shelf_count--;
+break;
+  }
+} adjc_iterate_end;
+  } whole_map_iterate_end;
+
+  /* continental shelf */
+  whole_map_iterate(ptile) {
+struct terrain *pterrain = tile_get_terrain(ptile);
+int shallow = 0;
+
+if (T_UNKNOWN == pterrain) {
+  continue;
+}
+if (!is_ocean(pterrain)) {
+  continue;
+}
+/* leave any other existing features in place */
+if (pterrain != shelf) {
+  continue;
+}
+
+adjc_iterate(ptile, tile2) {
+  if (T_UNKNOWN == tile2-terrain)
+continue;
+
+  switch (tile2-terrain-identifier) {
+  case TERRAIN_COAST_IDENTIFIER:
+shallow++;
+break;
+  default:
+break;
+  };
+} adjc_iterate_end;
+
+if (DEFAULT_NEAR_COAST  shallow) {
+  /* smooth with neighbors */
+  tile_change_terrain(ptile, coast);
+  update_tile_knowledge(ptile);
+  coast_count++;
+  shelf_count--;
+} else if (0 == shallow) {
+  tile_change_terrain(ptile, floor);
+  update_tile_knowledge(ptile);
+  floor_count++;
+  shelf_count--;
+}
+  } whole_map_iterate_end;
+
+  /* deep ocean floor */
+  whole_map_iterate(ptile) {
+struct terrain *pterrain = tile_get_terrain(ptile);
+int shallow = 0;
+
+if (T_UNKNOWN == pterrain) {
+  continue;
+}
+if (!is_ocean(pterrain)) {
+  continue;
+}
+/* leave any other existing features in place */
+if (pterrain != floor) {
+  continue;
+}
+
+adjc_iterate(ptile, tile2) {
+  if (T_UNKNOWN == tile2-terrain)
+continue;
+
+  switch