# HG changeset patch # Parent 2a7afe76de55af872594e971a0109e60d6fa6ae2 diff -r 2a7afe76de55 src/road_cmd.cpp --- a/src/road_cmd.cpp Tue May 12 17:45:19 2015 +0000 +++ b/src/road_cmd.cpp Wed May 13 20:00:03 2015 +0200 @@ -563,6 +563,15 @@ } return_cmd_error(STR_ERROR_ALREADY_BUILT); } + /* Disallow breaking end-of-line of someone else + * so trams can still reverse on this tile. */ + if (rt == ROADTYPE_TRAM && HasExactlyOneBit(existing)) { + Owner owner = GetRoadOwner(tile, rt); + if (Company::IsValidID(owner)) { + CommandCost ret = CheckOwnership(owner); + if (ret.Failed()) return ret; + } + } break; } diff -r 2a7afe76de55 src/station_cmd.cpp --- a/src/station_cmd.cpp Tue May 12 17:45:19 2015 +0000 +++ b/src/station_cmd.cpp Wed May 13 20:00:03 2015 +0200 @@ -963,7 +963,11 @@ /* There is a tram, check if we can build road+tram stop over it. */ if (HasBit(cur_rts, ROADTYPE_TRAM)) { Owner tram_owner = GetRoadOwner(cur_tile, ROADTYPE_TRAM); - if (!_settings_game.construction.road_stop_on_competitor_road && tram_owner != OWNER_NONE) { + if (Company::IsValidID(tram_owner) && + (!_settings_game.construction.road_stop_on_competitor_road || + /* Disallow breaking end-of-line of someone else + * so trams can still reverse on this tile. */ + HasExactlyOneBit(GetRoadBits(cur_tile, ROADTYPE_TRAM)))) { CommandCost ret = CheckOwnership(tram_owner); if (ret.Failed()) return ret; }