summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeterN <peter1138@openttd.org>2019-04-29 19:09:11 +0100
committerGitHub <noreply@github.com>2019-04-29 19:09:11 +0100
commit14dc8dd619b28d63d11cfd7411886e41b692b753 (patch)
tree598ee423c8e13ee55c2f92f851e8ac5f710d4830 /src
parent8cc6ee60eddd2585140a8ad7eba512e87b1fc894 (diff)
downloadopenttd-14dc8dd619b28d63d11cfd7411886e41b692b753.tar.xz
Fix 81d335b: Don't check state of widget not present in scenario editor. (#7551)
Diffstat (limited to 'src')
-rw-r--r--src/dock_gui.cpp4
-rw-r--r--src/road_gui.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp
index d74c6d2ca..e99d45676 100644
--- a/src/dock_gui.cpp
+++ b/src/dock_gui.cpp
@@ -105,7 +105,7 @@ struct BuildDocksToolbarWindow : Window {
~BuildDocksToolbarWindow()
{
- if (this->IsWidgetLowered(WID_DT_STATION)) SetViewportCatchmentStation(nullptr, true);
+ if (_game_mode != GM_EDITOR && this->IsWidgetLowered(WID_DT_STATION)) SetViewportCatchmentStation(nullptr, true);
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
}
@@ -249,7 +249,7 @@ struct BuildDocksToolbarWindow : Window {
void OnPlaceObjectAbort() override
{
- if (this->IsWidgetLowered(WID_DT_STATION)) SetViewportCatchmentStation(nullptr, true);
+ if (_game_mode != GM_EDITOR && this->IsWidgetLowered(WID_DT_STATION)) SetViewportCatchmentStation(nullptr, true);
this->RaiseButtons();
diff --git a/src/road_gui.cpp b/src/road_gui.cpp
index 78f5377da..ca3bd6d08 100644
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -327,7 +327,7 @@ struct BuildRoadToolbarWindow : Window {
~BuildRoadToolbarWindow()
{
- if (this->IsWidgetLowered(WID_ROT_BUS_STATION) || this->IsWidgetLowered(WID_ROT_TRUCK_STATION)) SetViewportCatchmentStation(nullptr, true);
+ if (_game_mode != GM_EDITOR && (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);
}
@@ -546,7 +546,7 @@ struct BuildRoadToolbarWindow : Window {
void OnPlaceObjectAbort() override
{
- if (this->IsWidgetLowered(WID_ROT_BUS_STATION) || this->IsWidgetLowered(WID_ROT_TRUCK_STATION)) SetViewportCatchmentStation(nullptr, true);
+ if (_game_mode != GM_EDITOR && (this->IsWidgetLowered(WID_ROT_BUS_STATION) || this->IsWidgetLowered(WID_ROT_TRUCK_STATION))) SetViewportCatchmentStation(nullptr, true);
this->RaiseButtons();
this->SetWidgetsDisabledState(true,