1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-03 03:49:12 +00:00

Codechange: Use IsValidCargoID/IsValidCargoType.

IsValidCargoType() is used only for unmapped IDs.
This commit is contained in:
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

@@ -184,7 +184,7 @@ bool Engine::CanCarryCargo() const
default: NOT_REACHED();
}
return this->GetDefaultCargoType() != CT_INVALID;
return IsValidCargoID(this->GetDefaultCargoType());
}
@@ -1256,7 +1256,7 @@ bool IsEngineRefittable(EngineID engine)
CargoID default_cargo = e->GetDefaultCargoType();
CargoTypes default_cargo_mask = 0;
SetBit(default_cargo_mask, default_cargo);
return default_cargo != CT_INVALID && ei->refit_mask != default_cargo_mask;
return IsValidCargoID(default_cargo) && ei->refit_mask != default_cargo_mask;
}
/**