[Freeciv-Dev] (PR#17435) 2.1.0-beta1: generator connects continents

2007-05-12 Thread Per I. Mathisen

http://bugs.freeciv.org/Ticket/Display.html?id=17435 >

> [EMAIL PROTECTED] - Wed Oct 11 08:31:24 2006]:
> 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

>  if (tile1->terrain != T_UNKNOWN
>   && !is_ocean(tile_get_terrain(tile1))) {
>return TRUE;

> Patch fixes it, does nothing about barbarian.c .

Patch just removes the tile1->terrain != T_UNKNOWN check above.
T_UNKNOWN is defined as NULL. Since this check is already done inside
is_ocean(), this cannot possibly be a fix (it would change nothing).

  - Per

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


Re: [Freeciv-Dev] (PR#17435) 2.1.0-beta1: generator connects continents

2006-10-11 Thread Brendon Oram

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