mirror of https://github.com/OpenTTD/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.pull/13017/head
parent
3eb7901ad9
commit
e3bfe2b668
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue