From 5f591c86fe0d49f18da12515facc884269497b08 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Fri, 8 Jan 2021 22:34:21 +0100 Subject: 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. --- src/engine.cpp | 2 ++ 1 file changed, 2 insertions(+) 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); -- cgit v1.2.3-70-g09d2