Skip to content

Commit

Permalink
Fix OpenTTD#7635: Game crash on exit scenario editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
stormcone authored and douiwby committed Apr 16, 2020
1 parent 450853a commit de9bd1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dock_gui.cpp
Expand Up @@ -105,7 +105,7 @@ struct BuildDocksToolbarWindow : Window {

~BuildDocksToolbarWindow()
{
if (_game_mode != GM_EDITOR && this->IsWidgetLowered(WID_DT_STATION)) SetViewportCatchmentStation(nullptr, true);
if (_game_mode == GM_NORMAL && this->IsWidgetLowered(WID_DT_STATION)) SetViewportCatchmentStation(nullptr, true);
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
}

Expand Down
2 changes: 1 addition & 1 deletion src/road_gui.cpp
Expand Up @@ -293,7 +293,7 @@ struct BuildRoadToolbarWindow : Window {

~BuildRoadToolbarWindow()
{
if (_game_mode != GM_EDITOR && (this->IsWidgetLowered(WID_ROT_BUS_STATION) || this->IsWidgetLowered(WID_ROT_TRUCK_STATION))) SetViewportCatchmentStation(nullptr, true);
if (_game_mode == GM_NORMAL && (this->IsWidgetLowered(WID_ROT_BUS_STATION) || this->IsWidgetLowered(WID_ROT_TRUCK_STATION))) SetViewportCatchmentStation(nullptr, true);
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
}

Expand Down

0 comments on commit de9bd1b

Please sign in to comment.