Codechange: Use IsValidCargoID/IsValidCargoType.

IsValidCargoType() is used only for unmapped IDs.
This commit is contained in:
Peter Nelson
2023-05-04 11:29:21 +01:00
committed by PeterN
parent c4ca6a0f74
commit 76516d7f70
30 changed files with 130 additions and 134 deletions

View File

@@ -340,7 +340,7 @@ static uint32 GetDistanceFromNearbyHouse(uint8 parameter, TileIndex tile, HouseI
/* Cargo acceptance history of nearby stations */
case 0x64: {
CargoID cid = GetCargoTranslation(parameter, this->ro.grffile);
if (cid == CT_INVALID) return 0;
if (!IsValidCargoID(cid)) return 0;
/* Extract tile offset. */
int8 x_offs = GB(GetRegister(0x100), 0, 8);