1
0
Fork 0

Fix: Don't invalidate water regions on the other side of the map.

When invalidating water regions with a tile at the very edge of the map, the region on the opposite side of the map would also be invalidated.
pull/13012/head
Peter Nelson 2024-10-19 16:31:02 +01:00
parent 9d2e07b1f6
commit d81b193333
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 2 additions and 1 deletions

View File

@ -324,7 +324,8 @@ void InvalidateWaterRegion(TileIndex tile)
* traversability. This means that if we invalidate any region edge tiles we might also change the traversability
* of the adjacent region. This code ensures the adjacent regions also get invalidated in such a case. */
for (DiagDirection side = DIAGDIR_BEGIN; side < DIAGDIR_END; side++) {
const TileIndex adjacent_tile = TileAddByDiagDir(tile, side);
const TileIndex adjacent_tile = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDiagDir(side));
if (adjacent_tile == INVALID_TILE) continue;
if (GetWaterRegionIndex(adjacent_tile) != GetWaterRegionIndex(tile)) invalidate_region(adjacent_tile);
}
}