Changeset - r28409:ddd9f9f09a4d
[Not reviewed]
master
0 1 0
Peter Nelson - 4 months ago 2024-01-05 21:50:37
peter1138@openttd.org
Codechange: Use CompanyMask to pass Companies to PopupMainCompanyToolbMenu().

It's like the type was designed for it.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/toolbar_gui.cpp
Show inline comments
 
@@ -145,9 +145,9 @@ static const int CTMN_SPECTATOR   = -3; 
 
 * Pop up a generic company list menu.
 
 * @param w The toolbar window.
 
 * @param widget The button widget id.
 
 * @param grey A bitbask of which items to mark as disabled.
 
 * @param grey A bitmask of which companies to mark as disabled.
 
 */
 
static void PopupMainCompanyToolbMenu(Window *w, WidgetID widget, int grey = 0)
 
static void PopupMainCompanyToolbMenu(Window *w, WidgetID widget, CompanyMask grey = 0)
 
{
 
	DropDownList list;
 

	
 
@@ -728,7 +728,7 @@ static CallBackFunction MenuClickIndustr
 

	
 
static void ToolbarVehicleClick(Window *w, VehicleType veh)
 
{
 
	int dis = 0;
 
	CompanyMask dis = 0;
 

	
 
	for (const Company *c : Company::Iterate()) {
 
		if (c->group_all[veh].num_vehicle == 0) SetBit(dis, c->index);
0 comments (0 inline, 0 general)