Author: jtn Date: Sat Apr 25 10:35:53 2015 New Revision: 28867 URL: http://svn.gna.org/viewcvs/freeciv?rev=28867&view=rev Log: Water tiles next to border sources were sometimes not claimed if they were also adjacent to another continent. Now they are always claimed.
After a report by Robin Patterson. See gna bug #23503. Modified: trunk/server/maphand.c Modified: trunk/server/maphand.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/maphand.c?rev=28867&r1=28866&r2=28867&view=diff ============================================================================== --- trunk/server/maphand.c (original) +++ trunk/server/maphand.c Sat Apr 25 10:35:53 2015 @@ -1815,6 +1815,7 @@ Continent_id cont1 = tile_continent(source); Continent_id cont2; int ocean_tiles; + bool other_continent; if (get_ocean_size(-cont) <= MAXIMUM_CLAIMED_OCEAN_SIZE && get_lake_surrounders(cont) == cont1) { @@ -1832,21 +1833,25 @@ } ocean_tiles = 0; + other_continent = FALSE; adjc_iterate(ptile, tile2) { cont2 = tile_continent(tile2); if (tile2 == source) { + /* Water next to border source is always claimable */ return TRUE; } if (cont2 == cont) { ocean_tiles++; } else if (cont1 <= 0) { - /* First adjacent land */ + /* First adjacent land (only if border source is not on land) */ cont1 = cont2; } else if (cont2 != cont1) { - return FALSE; /* two land continents adjacent, punt! */ + /* This water has two land continents adjacent, or land adjacent + * that is of a different continent from the border source */ + other_continent = TRUE; } } adjc_iterate_end; - if (ocean_tiles <= 2) { + if (!other_continent && ocean_tiles <= 2) { return TRUE; } else { return FALSE; @@ -2016,16 +2021,19 @@ if (strength_new <= strength_old) { /* Stronger shall prevail, - * in case of equel strength older shall prevail */ + * in case of equal strength older shall prevail */ continue; } } if (is_ocean_tile(dtile)) { + /* Only certain water tiles are claimable */ if (is_claimable_ocean(dtile, ptile, owner)) { map_claim_ownership(dtile, owner, ptile, dr == 0); } } else { + /* Only land tiles on the same island as the border source + * are claimable */ if (tile_continent(dtile) == tile_continent(ptile)) { map_claim_ownership(dtile, owner, ptile, dr == 0); } _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits