http://bugs.freeciv.org/Ticket/Display.html?id=17435 >
Think I found what was causing this, somehow a T_UNKNOWN check got in
the mapgen is_near_land function since Freeciv 2.08. Don't think
T_UNKNOWN has any place in the generator code and the function is local
to mapgen.c
---
/
Return TRUE if the ocean position is near land. This is used in the
creation of islands, so it differs logically from near_safe_tiles().
/
static bool is_near_land(struct tile *ptile)
{
/* Note this function may sometimes be called on land tiles. */
adjc_iterate(ptile, tile1) {
if (tile1->terrain != T_UNKNOWN
&& !is_ocean(tile_get_terrain(tile1))) {
return TRUE;
}
} adjc_iterate_end;
return FALSE;
}
---
My best guess is it was intended for the similar function in
server/barbarian.c
static bool is_near_land(struct tile *tile0)
{
square_iterate(tile0, 4, ptile) {
if (!is_ocean(tile_get_terrain(ptile))) {
return TRUE;
}
} square_iterate_end;
return FALSE;
}
---
Patch fixes it, does nothing about barbarian.c .
---Yautja
Index: server/generator/mapgen.c
===
--- server/generator/mapgen.c (revision 12345)
+++ server/generator/mapgen.c (working copy)
@@ -1522,8 +1522,7 @@
{
/* Note this function may sometimes be called on land tiles. */
adjc_iterate(ptile, tile1) {
-if (tile1->terrain != T_UNKNOWN
- && !is_ocean(tile_get_terrain(tile1))) {
+if (!is_ocean(tile_get_terrain(tile1))) {
return TRUE;
}
} adjc_iterate_end;
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev