summaryrefslogtreecommitdiff
path: root/src/newgrf_station.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-02-23 09:56:20 +0000
committerpeter1138 <peter1138@openttd.org>2007-02-23 09:56:20 +0000
commit7e73413709b3f830d83338421298af5dc20581db (patch)
tree2fa52d1955fc03be8152cb9d7b298bfce4b80664 /src/newgrf_station.cpp
parent0ed4b64e649349f695a1942e0fa09b8b564e1774 (diff)
downloadopenttd-7e73413709b3f830d83338421298af5dc20581db.tar.xz
(svn r8858) -Codechange: Replace magic number test with class method for determining if a cargo is valid/active.
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r--src/newgrf_station.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index 2d4f69790..ce9846d68 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -515,7 +515,7 @@ static const SpriteGroup *ResolveStation(ResolverObject *object)
/* Pick the first cargo that we have waiting */
for (CargoID cargo = 0; cargo < NUM_CARGO; cargo++) {
const CargoSpec *cs = GetCargo(cargo);
- if (cs->bitnum != 0xFF && object->u.station.statspec->spritegroup[cs->bitnum] != NULL &&
+ if (cs->IsValid() && object->u.station.statspec->spritegroup[cs->bitnum] != NULL &&
GB(object->u.station.st->goods[cargo].waiting_acceptance, 0, 12) != 0) {
ctype = cs->bitnum;
break;