mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r22638) -Fix: Keep the previous owner of the upper and lower lock parts if they are built on existing water.
This commit is contained in:
parent
d1be388bc9
commit
662a0a9cd3
|
@ -279,8 +279,8 @@ static CommandCost RemoveLock(TileIndex tile, DoCommandFlag flags)
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -421,8 +421,10 @@ static inline void MakeLock(TileIndex t, Owner o, DiagDirection d, WaterClass wc
|
|||
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 */
|
||||
|
|
Loading…
Reference in New Issue