1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 18:09:09 +00:00

Fix #8055, c02ef3e: Crash when roadtype availability changed with the road toolbar open (#8058)

This commit is contained in:
stormcone
2020-04-05 19:34:36 +02:00
committed by GitHub
parent 71e79edfc1
commit 2514f43909

View File

@@ -305,17 +305,6 @@ struct BuildRoadToolbarWindow : Window {
if (!gui_scope) return;
if (_game_mode != GM_EDITOR && !CanBuildVehicleInfrastructure(VEH_ROAD, GetRoadTramType(this->roadtype))) delete this;
bool can_build = _game_mode != GM_EDITOR;
this->SetWidgetsDisabledState(!can_build,
WID_ROT_DEPOT,
WID_ROT_BUS_STATION,
WID_ROT_TRUCK_STATION,
WIDGET_LIST_END);
if (!can_build) {
DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_ROAD);
DeleteWindowById(WC_BUS_STATION, TRANSPORT_ROAD);
DeleteWindowById(WC_TRUCK_STATION, TRANSPORT_ROAD);
}
}
void Initialize(RoadType roadtype)