summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 {