summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-06-21 09:31:50 +0000
committerfrosch <frosch@openttd.org>2015-06-21 09:31:50 +0000
commiteb909f278548a1cbd7f28dbfbe9261e3f37a4d7a (patch)
treee5adcd2795242ab1fa3e42a86084c768f6e4d510
parent62bc57db776192d9f1988628dfb1f27392f86c40 (diff)
downloadopenttd-eb909f278548a1cbd7f28dbfbe9261e3f37a4d7a.tar.xz
(svn r27312) -Fix-ish [FS#6317]: Preserve town ownership of bridges when removing road from a road+tram bridge. (marcole)
-rw-r--r--src/road_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 08db2fd95..aa445eb91 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -237,10 +237,10 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec
SetRoadTypes(tile, GetRoadTypes(tile) & ~RoadTypeToRoadTypes(rt));
/* If the owner of the bridge sells all its road, also move the ownership
- * to the owner of the other roadtype. */
+ * to the owner of the other roadtype, unless the bridge owner is a town. */
RoadType other_rt = (rt == ROADTYPE_ROAD) ? ROADTYPE_TRAM : ROADTYPE_ROAD;
Owner other_owner = GetRoadOwner(tile, other_rt);
- if (other_owner != GetTileOwner(tile)) {
+ if (!IsTileOwner(tile, other_owner) && !IsTileOwner(tile, OWNER_TOWN)) {
SetTileOwner(tile, other_owner);
SetTileOwner(other_end, other_owner);
}