Merge branch 'master' into jgrpp

This commit is contained in:
Jonathan G Rennison
2024-01-05 22:51:44 +00:00
2 changed files with 9 additions and 5 deletions

View File

@@ -156,9 +156,9 @@ static const int CTMN_SPECTATOR = -3; ///< Show a company window as spectator
* 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;
@@ -753,10 +753,10 @@ static CallBackFunction MenuClickIndustry(int index)
static void ToolbarVehicleClick(Window *w, VehicleType veh)
{
int dis = ~0;
CompanyMask dis = 0;
for (const Vehicle *v : Vehicle::Iterate()) {
if (v->type == veh && v->IsPrimaryVehicle()) ClrBit(dis, v->owner);
for (const Company *c : Company::Iterate()) {
if (c->group_all[veh].num_vehicle == 0) SetBit(dis, c->index);
}
PopupMainCompanyToolbMenu(w, WID_TN_VEHICLE_START + veh, dis);
}