Initial implementation of road waypoints

This commit is contained in:
Jonathan G Rennison
2022-01-25 22:02:32 +00:00
parent ace75f6864
commit b4fc0b4dc5
37 changed files with 546 additions and 87 deletions

View File

@@ -1967,7 +1967,7 @@ void DrawRoadCatenary(const TileInfo *ti)
tram = road = (GetCrossingRailAxis(ti->tile) == AXIS_Y ? ROAD_X : ROAD_Y);
}
} else if (IsTileType(ti->tile, MP_STATION)) {
if (IsRoadStop(ti->tile)) {
if (IsAnyRoadStop(ti->tile)) {
if (IsDriveThroughStopTile(ti->tile)) {
Axis axis = GetRoadStopDir(ti->tile) == DIAGDIR_NE ? AXIS_X : AXIS_Y;
tram = road = (axis == AXIS_X ? ROAD_X : ROAD_Y);
@@ -2976,7 +2976,7 @@ CommandCost CmdConvertRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
TileType tt = GetTileType(tile);
switch (tt) {
case MP_STATION:
if (!IsRoadStop(tile)) continue;
if (!IsAnyRoadStop(tile)) continue;
break;
case MP_ROAD:
if (IsLevelCrossing(tile) && RoadNoLevelCrossing(to_type)) {
@@ -3036,7 +3036,7 @@ CommandCost CmdConvertRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
}
uint num_pieces;
if (IsRoadDepotTile(tile) || IsRoadStopTile(tile)) {
if (IsRoadDepotTile(tile) || IsAnyRoadStopTile(tile)) {
num_pieces = HasTileRoadType(tile, rtt) ? 2 : 0;
} else {
num_pieces = CountBits(GetAnyRoadBits(tile, rtt));
@@ -3047,7 +3047,7 @@ CommandCost CmdConvertRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
if (flags & DC_EXEC) { // we can safely convert, too
/* Update the company infrastructure counters. */
if (!IsRoadStopTile(tile) && owner == _current_company) {
if (!IsAnyRoadStopTile(tile) && owner == _current_company) {
ConvertRoadTypeOwner(tile, num_pieces, owner, from_type, to_type);
} else {
UpdateCompanyRoadInfrastructure(from_type, owner, -(int)num_pieces);