diff src/engine.cpp @ 16160:c638d1941c58 draft

(svn r20856) -Fix [FS#4141]: Road/water toolbars did not get updated when the first vehicle of their type becomes available.
author terkhen <terkhen@openttd.org>
date Tue, 28 Sep 2010 21:58:06 +0000
parents a60a50f29f64
children 8c9974e20b1c
line wrap: on
line diff
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -605,6 +605,10 @@
 	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 @@
 	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()