Mercurial > hg > openttd
changeset 17847:178d22500708 draft
(svn r22638) -Fix: Keep the previous owner of the upper and lower lock parts if they are built on existing water.
author | michi_cc <michi_cc@openttd.org> |
---|---|
date | Thu, 07 Jul 2011 14:16:16 +0000 |
parents | 9783841ee5db |
children | c002a390f12a |
files | src/water_cmd.cpp src/water_map.h |
diffstat | 2 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -279,8 +279,8 @@ if (flags & DC_EXEC) { DoClearSquare(tile); - MakeWaterKeepingClass(tile + delta, GetTileOwner(tile)); - MakeWaterKeepingClass(tile - delta, GetTileOwner(tile)); + MakeWaterKeepingClass(tile + delta, GetTileOwner(tile + delta)); + MakeWaterKeepingClass(tile - delta, GetTileOwner(tile - delta)); MarkCanalsAndRiversAroundDirty(tile - delta); MarkCanalsAndRiversAroundDirty(tile + delta); }
--- a/src/water_map.h +++ b/src/water_map.h @@ -421,8 +421,10 @@ TileIndexDiff delta = TileOffsByDiagDir(d); MakeLockTile(t, o, LOCK_MIDDLE + d, WATER_CLASS_CANAL); - MakeLockTile(t - delta, o, LOCK_LOWER + d, wc_lower); - MakeLockTile(t + delta, o, LOCK_UPPER + d, wc_upper); + /* Keep the current owner for the upper and lower part if it is a + * water tile so we can restore the owner after deleting the lock. */ + MakeLockTile(t - delta, IsWaterTile(t - delta) ? GetTileOwner(t - delta) : o, LOCK_LOWER + d, wc_lower); + MakeLockTile(t + delta, IsWaterTile(t + delta) ? GetTileOwner(t + delta) : o, LOCK_UPPER + d, wc_upper); } #endif /* WATER_MAP_H */