Codechange: Split CT_INVALID into CT_INVALID and INVALID_CARGO.
INVALID_CARGO is a CargoID and should be used for most purposes in game. CT_INVALID is a CargoType used for defining default properties.
This commit is contained in:

committed by
Peter Nelson

parent
4fd986bd07
commit
952d111b94
@@ -52,12 +52,12 @@
|
||||
|
||||
/* static */ CargoID ScriptEngine::GetCargoType(EngineID engine_id)
|
||||
{
|
||||
if (!IsValidEngine(engine_id)) return CT_INVALID;
|
||||
if (!IsValidEngine(engine_id)) return INVALID_CARGO;
|
||||
|
||||
CargoArray cap = ::GetCapacityOfArticulatedParts(engine_id);
|
||||
|
||||
auto it = std::max_element(std::cbegin(cap), std::cend(cap));
|
||||
if (*it == 0) return CT_INVALID;
|
||||
if (*it == 0) return INVALID_CARGO;
|
||||
|
||||
return CargoID(std::distance(std::cbegin(cap), it));
|
||||
}
|
||||
|
Reference in New Issue
Block a user