1
0
Fork 0

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
Peter Nelson 2024-10-22 00:33:29 +01:00 committed by GitHub
parent 3eb7901ad9
commit e3bfe2b668
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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);
}
}