Do not get one way states when building road stops on tram-only tiles

This commit is contained in:
Jonathan G Rennison
2024-01-09 08:48:26 +00:00
parent a90cbd837e
commit 36776248b9
2 changed files with 12 additions and 8 deletions

View File

@@ -2214,11 +2214,13 @@ CommandCost CmdBuildRoadStop(TileIndex tile, DoCommandFlag flags, uint32_t p1, u
Owner tram_owner = tram_rt != INVALID_ROADTYPE ? GetRoadOwner(cur_tile, RTT_TRAM) : _current_company; Owner tram_owner = tram_rt != INVALID_ROADTYPE ? GetRoadOwner(cur_tile, RTT_TRAM) : _current_company;
DisallowedRoadDirections drd = DRD_NONE; DisallowedRoadDirections drd = DRD_NONE;
if (road_rt != INVALID_ROADTYPE) {
if (IsNormalRoadTile(cur_tile)){ if (IsNormalRoadTile(cur_tile)){
drd = GetDisallowedRoadDirections(cur_tile); drd = GetDisallowedRoadDirections(cur_tile);
} else if (IsDriveThroughStopTile(cur_tile)) { } else if (IsDriveThroughStopTile(cur_tile)) {
drd = GetDriveThroughStopDisallowedRoadDirections(cur_tile); drd = GetDriveThroughStopDisallowedRoadDirections(cur_tile);
} }
}
if (IsTileType(cur_tile, MP_STATION) && IsAnyRoadStop(cur_tile)) { if (IsTileType(cur_tile, MP_STATION) && IsAnyRoadStop(cur_tile)) {
RemoveRoadStop(cur_tile, flags, specindex); RemoveRoadStop(cur_tile, flags, specindex);

View File

@@ -464,11 +464,13 @@ CommandCost CmdBuildRoadWaypoint(TileIndex start_tile, DoCommandFlag flags, uint
Owner tram_owner = tram_rt != INVALID_ROADTYPE ? GetRoadOwner(cur_tile, RTT_TRAM) : _current_company; Owner tram_owner = tram_rt != INVALID_ROADTYPE ? GetRoadOwner(cur_tile, RTT_TRAM) : _current_company;
DisallowedRoadDirections drd = DRD_NONE; DisallowedRoadDirections drd = DRD_NONE;
if (road_rt != INVALID_ROADTYPE) {
if (IsNormalRoadTile(cur_tile)){ if (IsNormalRoadTile(cur_tile)){
drd = GetDisallowedRoadDirections(cur_tile); drd = GetDisallowedRoadDirections(cur_tile);
} else if (IsDriveThroughStopTile(cur_tile)) { } else if (IsDriveThroughStopTile(cur_tile)) {
drd = GetDriveThroughStopDisallowedRoadDirections(cur_tile); drd = GetDriveThroughStopDisallowedRoadDirections(cur_tile);
} }
}
extern CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags, int replacement_spec_index); extern CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags, int replacement_spec_index);
if (IsTileType(cur_tile, MP_STATION) && IsAnyRoadStop(cur_tile)) { if (IsTileType(cur_tile, MP_STATION) && IsAnyRoadStop(cur_tile)) {