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

I have confirmed that the island generator (gen 3) will
sometimes place islands in a way that there is no ocean
between them. I have also tested the patch and it solved
the problem in all my tests. Since the code looks fine I
will commit it soon (if no objections are raised).

Incidentally the patch does actually change the code.
To see this let A denote the value of the boolean
expression before the patch, and B that of it after.
Let I be the value of is_ocean(), U a boolean that
is true if the terrain is equal to T_UNKNOWN, and F
true if the terrain has the oceanic flag. Thus we have

I = !U && F

A = !U && !I
  = !U && !(!U && F)
  = !U && (!!U || !F)
  = !U && (U || !F)
  = (!U && U) || (!U && !F)
  = false || (!U && !F)
  = !U && !F

B = !I 
  = !(!U && F)
  = !!U || !F
  = U || !F
  != A

or in the first case is_near_land() returns TRUE if there
is an adjacent tile that is both not unknown and does not
have the oceanic flag, while in the second case it returns
TRUE if there is an adjacent tile that is either unknown
or does not have the oceanic flag.

Hence the reason the patch works is because it makes
is_near_land() assume unknown tiles could be land. :]


Freeciv-dev mailing list

Reply via email to