Changeset - r22135:e5923f9c21d4
[Not reviewed]
master
0 2 0
frosch - 9 years ago 2015-06-20 13:11:09
frosch@openttd.org
(svn r27308) -Fix [FS#6283]: Prevent breaking of tram-reversal points by adding more road pieces. (adf88)
2 files changed with 14 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/road_cmd.cpp
Show inline comments
 
@@ -560,12 +560,21 @@ CommandCost CmdBuildRoad(TileIndex tile,
 
								MarkTileDirtyByTile(tile);
 
							}
 
							return CommandCost();
 
						}
 
						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;
 
				}
 

	
 
				case ROAD_TILE_CROSSING:
 
					other_bits = GetCrossingRoadBits(tile);
 
					if (pieces & ComplementRoadBits(other_bits)) goto do_clear;
src/station_cmd.cpp
Show inline comments
 
@@ -960,13 +960,17 @@ static CommandCost CheckFlatLandRoadStop
 
					num_roadbits += CountBits(GetRoadBits(cur_tile, ROADTYPE_ROAD));
 
				}
 

	
 
				/* 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;
 
					}
 
					num_roadbits += CountBits(GetRoadBits(cur_tile, ROADTYPE_TRAM));
 
				}
 

	
0 comments (0 inline, 0 general)