From 36776248b9ceb076d56889a44fb9f90c69a3635c Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 9 Jan 2024 08:48:26 +0000 Subject: [PATCH] Do not get one way states when building road stops on tram-only tiles --- src/station_cmd.cpp | 10 ++++++---- src/waypoint_cmd.cpp | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 1d85600d44..e50c0efb51 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2214,10 +2214,12 @@ CommandCost CmdBuildRoadStop(TileIndex tile, DoCommandFlag flags, uint32_t p1, u Owner tram_owner = tram_rt != INVALID_ROADTYPE ? GetRoadOwner(cur_tile, RTT_TRAM) : _current_company; DisallowedRoadDirections drd = DRD_NONE; - if (IsNormalRoadTile(cur_tile)){ - drd = GetDisallowedRoadDirections(cur_tile); - } else if (IsDriveThroughStopTile(cur_tile)) { - drd = GetDriveThroughStopDisallowedRoadDirections(cur_tile); + if (road_rt != INVALID_ROADTYPE) { + if (IsNormalRoadTile(cur_tile)){ + drd = GetDisallowedRoadDirections(cur_tile); + } else if (IsDriveThroughStopTile(cur_tile)) { + drd = GetDriveThroughStopDisallowedRoadDirections(cur_tile); + } } if (IsTileType(cur_tile, MP_STATION) && IsAnyRoadStop(cur_tile)) { diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index bfe9aa5b4e..bbf326176b 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -464,10 +464,12 @@ CommandCost CmdBuildRoadWaypoint(TileIndex start_tile, DoCommandFlag flags, uint Owner tram_owner = tram_rt != INVALID_ROADTYPE ? GetRoadOwner(cur_tile, RTT_TRAM) : _current_company; DisallowedRoadDirections drd = DRD_NONE; - if (IsNormalRoadTile(cur_tile)){ - drd = GetDisallowedRoadDirections(cur_tile); - } else if (IsDriveThroughStopTile(cur_tile)) { - drd = GetDriveThroughStopDisallowedRoadDirections(cur_tile); + if (road_rt != INVALID_ROADTYPE) { + if (IsNormalRoadTile(cur_tile)){ + drd = GetDisallowedRoadDirections(cur_tile); + } else if (IsDriveThroughStopTile(cur_tile)) { + drd = GetDriveThroughStopDisallowedRoadDirections(cur_tile); + } } extern CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags, int replacement_spec_index);