summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-16 20:45:32 +0000
committerrubidium <rubidium@openttd.org>2009-03-16 20:45:32 +0000
commit7bbdd4f1196170b4abec8d5b1a2ccf6fad324d19 (patch)
treeafd5f5bcdecf7a90f36b33ab689d364d1c0b6e62
parent677b157943ced6db08c1ec29c392a6fe4f372921 (diff)
downloadopenttd-7bbdd4f1196170b4abec8d5b1a2ccf6fad324d19.tar.xz
(svn r15747) -Fix [FS#2736]: road ownership getting lost when removing a road stop.
-rw-r--r--src/station_cmd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 77ca29f54..2d97c2fd2 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1632,6 +1632,8 @@ CommandCost CmdRemoveRoadStop(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
((GetRoadStopDir(tile) == DIAGDIR_NE) ? ROAD_X : ROAD_Y) :
DiagDirToRoadBits(GetRoadStopDir(tile));
+ Owner road_owner = GetRoadOwner(tile, ROADTYPE_ROAD);
+ Owner tram_owner = GetRoadOwner(tile, ROADTYPE_TRAM);
CommandCost ret = RemoveRoadStop(st, flags, tile);
/* If the stop was a drive-through stop replace the road */
@@ -1640,7 +1642,7 @@ CommandCost CmdRemoveRoadStop(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
* removed by the owner of the roadstop, _current_company is the
* owner of the road stop. */
MakeRoadNormal(tile, road_bits, rts, ClosestTownFromTile(tile, UINT_MAX)->index,
- GetRoadOwner(tile, ROADTYPE_ROAD), GetRoadOwner(tile, ROADTYPE_TRAM));
+ road_owner, tram_owner);
}
return ret;