summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamuXarick <43006711+SamuXarick@users.noreply.github.com>2021-09-19 22:14:07 +0100
committerGitHub <noreply@github.com>2021-09-19 23:14:07 +0200
commit45edd9f326e810cec03f74d001ed082c886fc502 (patch)
tree7b1f5056272d293a02f0747cea53dbb8232fbdf0 /src
parent31cf9e888b1129ed8147a0ce1ee0bdbf7c121c9b (diff)
downloadopenttd-45edd9f326e810cec03f74d001ed082c886fc502.tar.xz
Fix: Incorrect error messages on placing water on scenario editor (#9560)
Additionally changes the behaviour of placing sea on sea/river/canal and placing canal/river on canal to (over)build, instead of disallowing it
Diffstat (limited to 'src')
-rw-r--r--src/water_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index a661cb38c..ba09b415a 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -477,8 +477,8 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
bool water = IsWaterTile(current_tile);
- /* can't make water of water! */
- if (water && (!IsTileOwner(current_tile, OWNER_WATER) || wc == WATER_CLASS_SEA)) continue;
+ /* Outside the editor, prevent building canals over your own or OWNER_NONE owned canals */
+ if (water && IsCanal(current_tile) && _game_mode != GM_EDITOR && (IsTileOwner(current_tile, _current_company) || IsTileOwner(current_tile, OWNER_NONE))) continue;
ret = DoCommand(current_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
if (ret.Failed()) return ret;