From 5880cf4c2cdb2e5e5fc0077b345cb49919ed54ef Mon Sep 17 00:00:00 2001 From: Alina Lenk Date: Sat, 11 May 2024 23:52:34 +0200 Subject: [PATCH 3/3] Check whether border should be cleared when reclaiming land from ocean See RM #590 Signed-off-by: Alina Lenk --- server/maphand.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/server/maphand.c b/server/maphand.c index b02a6e3def..c1822e04d8 100644 --- a/server/maphand.c +++ b/server/maphand.c @@ -2051,9 +2051,19 @@ void check_terrain_change(struct tile *ptile, struct terrain *oldter) } claimer = tile_claimer(ptile); - if (claimer != NULL && is_ocean_tile(ptile)) { - if (!is_claimable_ocean(ptile, claimer, tile_owner(ptile))) { - map_clear_border(ptile); + if (claimer != NULL) { + /* Make sure map_claim_border() conditions are still satisfied */ + if (is_ocean_tile(ptile)) { + /* Only certain water tiles are claimable */ + if (!is_claimable_ocean(ptile, claimer, tile_owner(ptile))) { + map_clear_border(ptile); + } + } else { + /* Only land tiles on the same island as the border source + * are claimable */ + if (tile_continent(ptile) != tile_continent(claimer)) { + map_clear_border(ptile); + } } } -- 2.34.1