forked from mirror/OpenTTD
Fix: Don't invalidate water regions on the other side of the map. (#13012)
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user