Codechange: rename CargoID to CargoType and amend related variables/comments
This commit is contained in:
@@ -69,15 +69,15 @@ uint16_t GetCargoCallback(CallbackID callback, uint32_t param1, uint32_t param2,
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate a GRF-local cargo slot/bitnum into a CargoID.
|
||||
* Translate a GRF-local cargo slot/bitnum into a CargoType.
|
||||
* @param cargo GRF-local cargo slot/bitnum.
|
||||
* @param grffile Originating GRF file.
|
||||
* @param usebit Defines the meaning of \a cargo for GRF version < 7.
|
||||
* If true, then \a cargo is a bitnum. If false, then \a cargo is a cargoslot.
|
||||
* For GRF version >= 7 \a cargo is always a translated cargo bit.
|
||||
* @return CargoID or INVALID_CARGO if the cargo is not available.
|
||||
* @return CargoType or INVALID_CARGO if the cargo is not available.
|
||||
*/
|
||||
CargoID GetCargoTranslation(uint8_t cargo, const GRFFile *grffile, bool usebit)
|
||||
CargoType GetCargoTranslation(uint8_t cargo, const GRFFile *grffile, bool usebit)
|
||||
{
|
||||
/* We can't use GetCargoTranslationTable here as the usebit flag changes behviour. */
|
||||
/* Pre-version 7 uses the bitnum lookup from (standard in v8) instead of climate dependent in some places.. */
|
||||
@@ -90,6 +90,6 @@ CargoID GetCargoTranslation(uint8_t cargo, const GRFFile *grffile, bool usebit)
|
||||
cargo_list = GetClimateIndependentCargoTranslationTable();
|
||||
}
|
||||
|
||||
if (cargo < cargo_list.size()) return GetCargoIDByLabel(cargo_list[cargo]);
|
||||
if (cargo < cargo_list.size()) return GetCargoTypeByLabel(cargo_list[cargo]);
|
||||
return INVALID_CARGO;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user