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:
Peter Nelson
2024-01-06 15:15:37 +00:00
committed by Peter Nelson
parent 4fd986bd07
commit 952d111b94
36 changed files with 131 additions and 129 deletions

View File

@@ -189,7 +189,7 @@ public:
}
/** Bare constructor, only for save/load. */
LinkGraph() : cargo(CT_INVALID), last_compression(0) {}
LinkGraph() : cargo(INVALID_CARGO), last_compression(0) {}
/**
* Real constructor.
* @param cargo Cargo the link graph is about.

View File

@@ -21,7 +21,7 @@
* Only the cargo type of the most saturated linkgraph is taken into account.
*/
struct LinkProperties {
LinkProperties() : cargo(CT_INVALID), capacity(0), usage(0), planned(0), shared(false) {}
LinkProperties() : cargo(INVALID_CARGO), capacity(0), usage(0), planned(0), shared(false) {}
/** Return the usage of the link to display. */
uint Usage() const { return std::max(this->usage, this->planned); }

View File

@@ -67,7 +67,7 @@ bool LinkRefresher::Hop::operator<(const Hop &other) const
* @param is_full_loading If the vehicle is full loading.
*/
LinkRefresher::LinkRefresher(Vehicle *vehicle, HopSet *seen_hops, bool allow_merge, bool is_full_loading) :
vehicle(vehicle), seen_hops(seen_hops), cargo(CT_INVALID), allow_merge(allow_merge),
vehicle(vehicle), seen_hops(seen_hops), cargo(INVALID_CARGO), allow_merge(allow_merge),
is_full_loading(is_full_loading)
{
memset(this->capacities, 0, sizeof(this->capacities));

View File

@@ -56,7 +56,7 @@ protected:
struct Hop {
OrderID from; ///< Last order where vehicle could interact with cargo or absolute first order.
OrderID to; ///< Next order to be processed.
CargoID cargo; ///< Cargo the consist is probably carrying or CT_INVALID if unknown.
CargoID cargo; ///< Cargo the consist is probably carrying or INVALID_CARGO if unknown.
/**
* Default constructor should not be called but has to be visible for