Changeset - r10129:c2bd7bc13408
[Not reviewed]
master
0 1 0
smatz - 16 years ago 2008-09-13 17:26:44
smatz@openttd.org
(svn r14315) -Fix: allow adding roadtypes only to drive-through road stops
1 file changed with 9 insertions and 11 deletions:
0 comments (0 inline, 0 general)
src/road_cmd.cpp
Show inline comments
 
@@ -576,17 +576,14 @@ CommandCost CmdBuildRoad(TileIndex tile,
 
			return CommandCost(EXPENSES_CONSTRUCTION, _price.build_road * (rt == ROADTYPE_ROAD ? 2 : 4));
 
		}
 

	
 
		case MP_STATION:
 
			if (!IsRoadStop(tile)) goto do_clear;
 
			if (IsDriveThroughStopTile(tile)) {
 
				RoadBits curbits = AxisToRoadBits(DiagDirToAxis(GetRoadStopDir(tile)));
 
				if (pieces & ~curbits) goto do_clear;
 
				pieces = curbits; // we need to pay for both roadbits
 
			} else {
 
				if (pieces & ~DiagDirToRoadBits(GetRoadStopDir(tile))) goto do_clear;
 
			}
 
		case MP_STATION: {
 
			if (!IsDriveThroughStopTile(tile)) goto do_clear;
 
			if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
 
			break;
 

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

	
 
		case MP_TUNNELBRIDGE:
 
			if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
 
@@ -674,8 +671,9 @@ do_clear:;
 
			} break;
 

	
 
			case MP_STATION:
 
				assert(IsDriveThroughStopTile(tile));
 
				SetRoadTypes(tile, GetRoadTypes(tile) | RoadTypeToRoadTypes(rt));
 
				if (IsDriveThroughStopTile(tile) && rt == ROADTYPE_ROAD) SetStopBuiltOnTownRoad(tile, false);
 
				if (rt == ROADTYPE_ROAD) SetStopBuiltOnTownRoad(tile, false);
 
				break;
 

	
 
			default:
0 comments (0 inline, 0 general)