Codechange: Use reference for always_accepted output parameter of AddAcceptedCargo. (#12854)

This parameter should always present (see tile_cmd.h:186), so use a reference to ensure it is.
This commit is contained in:
2024-07-10 12:30:14 +01:00
committed by GitHub
parent 60c3913a99
commit 93eb27d8df
4 changed files with 18 additions and 11 deletions

View File

@@ -617,7 +617,7 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags)
return cost;
}
static void AddAcceptedCargo_Object(TileIndex tile, CargoArray &acceptance, CargoTypes *always_accepted)
static void AddAcceptedCargo_Object(TileIndex tile, CargoArray &acceptance, CargoTypes &always_accepted)
{
if (!IsObjectType(tile, OBJECT_HQ)) return;
@@ -632,7 +632,7 @@ static void AddAcceptedCargo_Object(TileIndex tile, CargoArray &acceptance, Carg
CargoID pass = GetCargoIDByLabel(CT_PASSENGERS);
if (IsValidCargoID(pass)) {
acceptance[pass] += std::max(1U, level);
SetBit(*always_accepted, pass);
SetBit(always_accepted, pass);
}
/* Top town building generates 4, HQ can make up to 8. The
@@ -642,7 +642,7 @@ static void AddAcceptedCargo_Object(TileIndex tile, CargoArray &acceptance, Carg
CargoID mail = GetCargoIDByLabel(CT_MAIL);
if (IsValidCargoID(mail)) {
acceptance[mail] += std::max(1U, level / 2);
SetBit(*always_accepted, mail);
SetBit(always_accepted, mail);
}
}