(svn r22051) -Fix (r21935): Roads under road stops would get a wrong owner after overbuilding.
This commit is contained in:
@@ -1747,6 +1747,8 @@ CommandCost CmdBuildRoadStop(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
|||||||
/* Check every tile in the area. */
|
/* Check every tile in the area. */
|
||||||
TILE_AREA_LOOP(cur_tile, roadstop_area) {
|
TILE_AREA_LOOP(cur_tile, roadstop_area) {
|
||||||
RoadTypes cur_rts = GetRoadTypes(cur_tile);
|
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)) {
|
if (IsTileType(cur_tile, MP_STATION) && IsRoadStop(cur_tile)) {
|
||||||
RemoveRoadStop(cur_tile, flags);
|
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;
|
RoadStopType rs_type = type ? ROADSTOP_TRUCK : ROADSTOP_BUS;
|
||||||
if (is_drive_through) {
|
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));
|
MakeDriveThroughRoadStop(cur_tile, st->owner, road_owner, tram_owner, st->index, rs_type, rts | cur_rts, DiagDirToAxis(ddir));
|
||||||
road_stop->MakeDriveThrough();
|
road_stop->MakeDriveThrough();
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user