summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-02-10 18:32:08 +0000
committerterkhen <terkhen@openttd.org>2011-02-10 18:32:08 +0000
commit57a969017bc6fae18bb4db9867364ceb5ebe260f (patch)
tree6103faffefecc17c9cc094839afac855e9dfbb3a /src
parent50996e799bc0a2abaca04eb5e4d81dc2fef4a2a7 (diff)
downloadopenttd-57a969017bc6fae18bb4db9867364ceb5ebe260f.tar.xz
(svn r22051) -Fix (r21935): Roads under road stops would get a wrong owner after overbuilding.
Diffstat (limited to 'src')
-rw-r--r--src/station_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 5e72ded7f..4d64b3c03 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1747,6 +1747,8 @@ CommandCost CmdBuildRoadStop(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
/* Check every tile in the area. */
TILE_AREA_LOOP(cur_tile, roadstop_area) {
RoadTypes cur_rts = GetRoadTypes(cur_tile);
+ Owner road_owner = HasBit(cur_rts, ROADTYPE_ROAD) ? GetRoadOwner(cur_tile, ROADTYPE_ROAD) : _current_company;
+ Owner tram_owner = HasBit(cur_rts, ROADTYPE_TRAM) ? GetRoadOwner(cur_tile, ROADTYPE_TRAM) : _current_company;
if (IsTileType(cur_tile, MP_STATION) && IsRoadStop(cur_tile)) {
RemoveRoadStop(cur_tile, flags);
@@ -1770,8 +1772,6 @@ CommandCost CmdBuildRoadStop(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
RoadStopType rs_type = type ? ROADSTOP_TRUCK : ROADSTOP_BUS;
if (is_drive_through) {
- Owner road_owner = HasBit(cur_rts, ROADTYPE_ROAD) ? GetRoadOwner(cur_tile, ROADTYPE_ROAD) : _current_company;
- Owner tram_owner = HasBit(cur_rts, ROADTYPE_TRAM) ? GetRoadOwner(cur_tile, ROADTYPE_TRAM) : _current_company;
MakeDriveThroughRoadStop(cur_tile, st->owner, road_owner, tram_owner, st->index, rs_type, rts | cur_rts, DiagDirToAxis(ddir));
road_stop->MakeDriveThrough();
} else {