summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-14 15:34:30 +0000
committerrubidium <rubidium@openttd.org>2009-03-14 15:34:30 +0000
commitaea8e7291e77859cbf5cdb04aa795a510c599504 (patch)
tree0e0eff294a346783cdde523dee58562c2be47518 /src
parent2e6e2457f12b272716cfc738dee4694fbe4b65a5 (diff)
downloadopenttd-aea8e7291e77859cbf5cdb04aa795a510c599504.tar.xz
(svn r15709) -Change [FS#2729]: be a tad more specific about the fact that you're building incompatible tracks when building incompatible track types on the same tile.
Diffstat (limited to 'src')
-rw-r--r--src/rail_cmd.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index ae7178c18..ddeda2818 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -319,15 +319,14 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u
switch (GetTileType(tile)) {
case MP_RAILWAY:
+ if (!CheckTileOwnership(tile)) return CMD_ERROR;
+
+ if (!IsCompatibleRail(GetRailType(tile), railtype)) return_cmd_error(STR_1001_IMPOSSIBLE_TRACK_COMBINATION);
+
if (!CheckTrackCombination(tile, trackbit, flags) ||
!EnsureNoTrainOnTrack(tile, track)) {
return CMD_ERROR;
}
- if (!IsTileOwner(tile, _current_company) ||
- !IsCompatibleRail(GetRailType(tile), railtype)) {
- /* Get detailed error message */
- return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
- }
ret = CheckRailSlope(tileh, trackbit, GetTrackBits(tile), tile);
if (CmdFailed(ret)) return ret;