diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 92c660e..65e4dd9 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -60,6 +60,7 @@ DECLARE_ENUM_AS_BIT_SET(RoadFlags) static RoadFlags _place_road_flag; static RoadType _cur_roadtype; +bool _catenary_flag; static DiagDirection _road_depot_orientation; static DiagDirection _road_station_picker_orientation; @@ -626,7 +627,7 @@ struct BuildRoadToolbarWindow : Window { * not the 3rd bit set) */ _place_road_flag = (RoadFlags)((_place_road_flag & RF_DIR_Y) ? (_place_road_flag & 0x07) : (_place_road_flag >> 3)); - DoCommandP(start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 5), + DoCommandP(start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 5) | (_catenary_flag << 7), _remove_button_clicked ? CMD_REMOVE_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_road) : CMD_BUILD_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road), CcPlaySound1D); @@ -802,13 +803,13 @@ static WindowDesc _build_tramway_desc( * * @return newly opened road toolbar, or NULL if the toolbar could not be opened. */ -Window *ShowBuildRoadToolbar(RoadType roadtype) +Window *ShowBuildRoadToolbar(RoadType roadtype, bool _catenary_flag) { if (!Company::IsValidID(_local_company)) return NULL; _cur_roadtype = roadtype; DeleteWindowByClass(WC_BUILD_TOOLBAR); - return AllocateWindowDescFront(roadtype == ROADTYPE_ROAD ? &_build_road_desc : &_build_tramway_desc, TRANSPORT_ROAD); + return AllocateWindowDescFront(roadtype == ROADTYPE_ROAD ? &_build_road_desc : &_build_tramway_desc, TRANSPORT_ROAD, _catenary_flag); } static const NWidgetPart _nested_build_road_scen_widgets[] = {