summaryrefslogtreecommitdiff
path: root/src/cargo_type.h
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2018-07-26 23:09:35 +0200
committerNiels Martin Hansen <nielsm@indvikleren.dk>2018-11-03 21:43:54 +0100
commit9b560eaa518124398129f19b58735c73f9677ce0 (patch)
tree9dffda8b55a8709e62c95d17f2f9c8c2a3c667b9 /src/cargo_type.h
parente66cec8f86357918c58b20bd3cc67330f277a5e1 (diff)
downloadopenttd-9b560eaa518124398129f19b58735c73f9677ce0.tar.xz
Fix: Industry chain window layout no more unnecessarily large when the number of cargoes in/out isn't large either
Diffstat (limited to 'src/cargo_type.h')
-rw-r--r--src/cargo_type.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cargo_type.h b/src/cargo_type.h
index 1eca0edff..79d1c84f4 100644
--- a/src/cargo_type.h
+++ b/src/cargo_type.h
@@ -70,6 +70,11 @@ enum CargoType {
CT_INVALID = 0xFF, ///< Invalid cargo type.
};
+/** Test whether cargo type is not CT_INVALID */
+inline bool IsCargoTypeValid(CargoType t) { return t != CT_INVALID; }
+/** Test whether cargo type is not CT_INVALID */
+inline bool IsCargoIDValid(CargoID t) { return t != CT_INVALID; }
+
typedef uint64 CargoTypes;
static const CargoTypes ALL_CARGOTYPES = (CargoTypes)UINT64_MAX;