diff options
author | peter1138 <peter1138@openttd.org> | 2007-02-23 09:56:20 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-02-23 09:56:20 +0000 |
commit | b3efec2e7d6ca583b3477ef3407844093a216a38 (patch) | |
tree | 2fa52d1955fc03be8152cb9d7b298bfce4b80664 /src/cargotype.cpp | |
parent | dfa3c0aae1b5918588e96777fe5c108301810717 (diff) | |
download | openttd-b3efec2e7d6ca583b3477ef3407844093a216a38.tar.xz |
(svn r8858) -Codechange: Replace magic number test with class method for determining if a cargo is valid/active.
Diffstat (limited to 'src/cargotype.cpp')
-rw-r--r-- | src/cargotype.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cargotype.cpp b/src/cargotype.cpp index 0cfd7e2e9..28fbce38b 100644 --- a/src/cargotype.cpp +++ b/src/cargotype.cpp @@ -67,3 +67,9 @@ CargoID GetCargoIDByBitnum(byte bitnum) assert(_cargo_bitnum_map[bitnum] != CT_INVALID); return _cargo_bitnum_map[bitnum]; } + + +bool CargoSpec::IsValid() const +{ + return bitnum != INVALID_CARGO; +} |