|
@@ -862,13 +862,13 @@ do_clear:;
|
|
|
* the present road type are powered on the new road type. */
|
|
|
RoadType existing_rt = GetRoadType(tile, rtt);
|
|
|
if (existing_rt != INVALID_ROADTYPE && existing_rt != rt) {
|
|
|
if (HasPowerOnRoad(rt, existing_rt)) {
|
|
|
rt = existing_rt;
|
|
|
} else if (HasPowerOnRoad(existing_rt, rt)) {
|
|
|
CommandCost ret = Command<CMD_CONVERT_ROAD>::Do(flags, tile, tile, rt);
|
|
|
ret = Command<CMD_CONVERT_ROAD>::Do(flags, tile, tile, rt);
|
|
|
if (ret.Failed()) return ret;
|
|
|
cost.AddCost(ret);
|
|
|
} else {
|
|
|
return CMD_ERROR;
|
|
|
}
|
|
|
}
|
|
@@ -1712,13 +1712,13 @@ static void DrawTile_Road(TileInfo *ti)
|
|
|
|
|
|
DrawRoadOverlays(ti, pal, road_rti, tram_rti, axis, axis);
|
|
|
|
|
|
/* Draw rail/PBS overlay */
|
|
|
bool draw_pbs = _game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasCrossingReservation(ti->tile);
|
|
|
if (rti->UsesOverlay()) {
|
|
|
PaletteID pal = draw_pbs ? PALETTE_CRASH : PAL_NONE;
|
|
|
pal = draw_pbs ? PALETTE_CRASH : PAL_NONE;
|
|
|
SpriteID rail = GetCustomRailSprite(rti, ti->tile, RTSG_CROSSING) + axis;
|
|
|
DrawGroundSprite(rail, pal);
|
|
|
|
|
|
const Axis road_axis = GetCrossingRoadAxis(ti->tile);
|
|
|
const DiagDirection dir1 = AxisToDiagDir(road_axis);
|
|
|
const DiagDirection dir2 = ReverseDiagDir(dir1);
|
|
@@ -1754,13 +1754,13 @@ static void DrawTile_Road(TileInfo *ti)
|
|
|
default:
|
|
|
/* Show no sprites */
|
|
|
break;
|
|
|
}
|
|
|
} else if (draw_pbs || tram_rti != nullptr || road_rti->UsesOverlay()) {
|
|
|
/* Add another rail overlay, unless there is only the base road sprite. */
|
|
|
PaletteID pal = draw_pbs ? PALETTE_CRASH : PAL_NONE;
|
|
|
pal = draw_pbs ? PALETTE_CRASH : PAL_NONE;
|
|
|
SpriteID rail = GetCrossingRoadAxis(ti->tile) == AXIS_Y ? GetRailTypeInfo(GetRailType(ti->tile))->base_sprites.single_x : GetRailTypeInfo(GetRailType(ti->tile))->base_sprites.single_y;
|
|
|
DrawGroundSprite(rail, pal);
|
|
|
}
|
|
|
|
|
|
/* Draw road, tram catenary */
|
|
|
DrawRoadCatenary(ti);
|