Skip to content

Commit

Permalink
Fix 85a49a0: invalidate airport toolbar when new planes become availa…
Browse files Browse the repository at this point in the history
…ble (#8532)

Otherwise if the airport button is disabled, it will remain disabled
until you close/open the toolbar again.
  • Loading branch information
TrueBrain committed Jan 8, 2021
1 parent 31d1968 commit 5f591c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/engine.cpp
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5f591c8

Please sign in to comment.