summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-01-08 22:34:21 +0100
committerGitHub <noreply@github.com>2021-01-08 22:34:21 +0100
commit5f591c86fe0d49f18da12515facc884269497b08 (patch)
treee9da61f34e66fe53e78eb1bcc318c9ca6fc4191b /src/engine.cpp
parent31d19680043cecaaca31dba3fee341699db1b7a3 (diff)
downloadopenttd-5f591c86fe0d49f18da12515facc884269497b08.tar.xz
Fix 85a49a0d: invalidate airport toolbar when new planes become available (#8532)
Otherwise if the airport button is disabled, it will remain disabled until you close/open the toolbar again.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 2681b8fa6..e73fdb058 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -735,6 +735,7 @@ static void EnableEngineForCompany(EngineID eid, CompanyID company)
InvalidateWindowData(WC_MAIN_TOOLBAR, 0);
if (e->type == VEH_ROAD) InvalidateWindowData(WC_BUILD_TOOLBAR, TRANSPORT_ROAD);
if (e->type == VEH_SHIP) InvalidateWindowData(WC_BUILD_TOOLBAR, TRANSPORT_WATER);
+ if (e->type == VEH_AIRCRAFT) InvalidateWindowData(WC_BUILD_TOOLBAR, TRANSPORT_AIR);
}
}
@@ -1018,6 +1019,7 @@ static void NewVehicleAvailable(Engine *e)
/* Update the toolbar. */
if (e->type == VEH_ROAD) InvalidateWindowData(WC_BUILD_TOOLBAR, TRANSPORT_ROAD);
if (e->type == VEH_SHIP) InvalidateWindowData(WC_BUILD_TOOLBAR, TRANSPORT_WATER);
+ if (e->type == VEH_AIRCRAFT) InvalidateWindowData(WC_BUILD_TOOLBAR, TRANSPORT_AIR);
/* Close pending preview windows */
DeleteWindowById(WC_ENGINE_PREVIEW, index);