summaryrefslogtreecommitdiff
path: root/src/road_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-06-20 13:11:09 +0000
committerfrosch <frosch@openttd.org>2015-06-20 13:11:09 +0000
commit904688c00a14cadce0c8a651146b305a33d39523 (patch)
tree6fa9d4952e4ffef06b885e258d692aa8c29c5318 /src/road_cmd.cpp
parentbf64a8c2006bae1734c2f7f1f7dc89b7474597f3 (diff)
downloadopenttd-904688c00a14cadce0c8a651146b305a33d39523.tar.xz
(svn r27308) -Fix [FS#6283]: Prevent breaking of tram-reversal points by adding more road pieces. (adf88)
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r--src/road_cmd.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index dcf9b23d0..449a8016b 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -563,6 +563,15 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
}
return_cmd_error(STR_ERROR_ALREADY_BUILT);
}
+ /* Disallow breaking end-of-line of someone else
+ * so trams can still reverse on this tile. */
+ if (rt == ROADTYPE_TRAM && HasExactlyOneBit(existing)) {
+ Owner owner = GetRoadOwner(tile, rt);
+ if (Company::IsValidID(owner)) {
+ CommandCost ret = CheckOwnership(owner);
+ if (ret.Failed()) return ret;
+ }
+ }
break;
}