Changeset - r10130:205e8ead41fd
[Not reviewed]
master
0 1 0
smatz - 16 years ago 2008-09-13 17:37:18
smatz@openttd.org
(svn r14316) -Fix: do not allow building road over level crossings and drive-through road stops in the wrong direction even when the roadtype is present
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/road_cmd.cpp
Show inline comments
 
@@ -523,10 +523,11 @@ CommandCost CmdBuildRoad(TileIndex tile,
 
				} break;
 

	
 
				case ROAD_TILE_CROSSING:
 
					if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
 
					other_bits = GetCrossingRoadBits(tile);
 
					if (pieces & ComplementRoadBits(other_bits)) goto do_clear;
 
					pieces = other_bits; // we need to pay for both roadbits
 

	
 
					if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
 
					break;
 

	
 
				default:
 
@@ -578,11 +579,12 @@ CommandCost CmdBuildRoad(TileIndex tile,
 

	
 
		case MP_STATION: {
 
			if (!IsDriveThroughStopTile(tile)) goto do_clear;
 
			if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
 

	
 
			RoadBits curbits = AxisToRoadBits(DiagDirToAxis(GetRoadStopDir(tile)));
 
			if (pieces & ~curbits) goto do_clear;
 
			pieces = curbits; // we need to pay for both roadbits
 

	
 
			if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
 
		} break;
 

	
 
		case MP_TUNNELBRIDGE:
0 comments (0 inline, 0 general)