1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-03 11:59:15 +00:00

(svn r20856) -Fix [FS#4141]: Road/water toolbars did not get updated when the first vehicle of their type becomes available.

This commit is contained in:
terkhen
2010-09-28 21:58:06 +00:00
parent 97c0b40ab7
commit 897bb71621
3 changed files with 28 additions and 6 deletions

View File

@@ -605,6 +605,10 @@ static void AcceptEnginePreview(EngineID eid, CompanyID company)
if (company == _local_company) {
AddRemoveEngineFromAutoreplaceAndBuildWindows(e->type);
}
/* 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);
}
/**
@@ -749,6 +753,10 @@ static void NewVehicleAvailable(Engine *e)
SetDParam(0, GetEngineCategoryName(index));
SetDParam(1, index);
AddNewsItem(STR_NEWS_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE, NS_NEW_VEHICLES, NR_ENGINE, index);
/* 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);
}
void EnginesMonthlyLoop()