diff options
author | planetmaker <planetmaker@openttd.org> | 2011-12-13 23:01:36 +0000 |
---|---|---|
committer | planetmaker <planetmaker@openttd.org> | 2011-12-13 23:01:36 +0000 |
commit | 8c48fd1fe57e9caa33fb9ab955e139627d7d4e03 (patch) | |
tree | ac8a9847f98295d3bb08aa4832ceae039270095b /src/water_map.h | |
parent | 86c19475799bd3857414903668a5daa4c54d0569 (diff) | |
download | openttd-8c48fd1fe57e9caa33fb9ab955e139627d7d4e03.tar.xz |
(svn r23512) -Change [FS#4872]: Allow to place locks also on river rapids and restore rivers, if locks are deleted
Diffstat (limited to 'src/water_map.h')
-rw-r--r-- | src/water_map.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/water_map.h b/src/water_map.h index 14b7c1329..cfec9cc38 100644 --- a/src/water_map.h +++ b/src/water_map.h @@ -466,14 +466,15 @@ static inline void MakeLockTile(TileIndex t, Owner o, LockPart part, DiagDirecti * @param d Direction of the water lock. * @param wc_lower Original water class of the lower part. * @param wc_upper Original water class of the upper part. + * @param wc_middle Original water class of the middle part. */ -static inline void MakeLock(TileIndex t, Owner o, DiagDirection d, WaterClass wc_lower, WaterClass wc_upper) +static inline void MakeLock(TileIndex t, Owner o, DiagDirection d, WaterClass wc_lower, WaterClass wc_upper, WaterClass wc_middle) { TileIndexDiff delta = TileOffsByDiagDir(d); - MakeLockTile(t, o, LOCK_PART_MIDDLE, d, WATER_CLASS_CANAL); - /* 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. */ + /* Keep the current waterclass and owner for the tiles. + * It allows to restore them after the lock is deleted */ + MakeLockTile(t, o, LOCK_PART_MIDDLE, d, wc_middle); MakeLockTile(t - delta, IsWaterTile(t - delta) ? GetTileOwner(t - delta) : o, LOCK_PART_LOWER, d, wc_lower); MakeLockTile(t + delta, IsWaterTile(t + delta) ? GetTileOwner(t + delta) : o, LOCK_PART_UPPER, d, wc_upper); } |