summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-08-30 08:59:55 +0000
committerpeter1138 <peter1138@openttd.org>2008-08-30 08:59:55 +0000
commit2b67c01a24441555ec11ec102c0ab945fdf28981 (patch)
treeee69c3542d7ee567c9e64cc24097c359b722f4ce /src/newgrf.cpp
parent468655c916975f88da0fe66488a15004848e2b81 (diff)
downloadopenttd-2b67c01a24441555ec11ec102c0ab945fdf28981.tar.xz
(svn r14188) -Codechange: [NewGRF] Cargo type of 0xFF is specified to be 'use first refittable cargo', so don't issue a warning for it.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 35c604bb6..6c230145d 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -539,6 +539,9 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
if (ctype < NUM_CARGO && HasBit(_cargo_mask, ctype)) {
rvi->cargo_type = ctype;
+ } else if (ctype == 0xFF) {
+ /* 0xFF is specified as 'use first refittable' */
+ rvi->cargo_type = CT_INVALID;
} else {
rvi->cargo_type = CT_INVALID;
grfmsg(2, "RailVehicleChangeInfo: Invalid cargo type %d, using first refittable", ctype);
@@ -732,8 +735,9 @@ static bool RoadVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
if (cargo < NUM_CARGO && HasBit(_cargo_mask, cargo)) {
rvi->cargo_type = cargo;
- } else {
+ } else if (cargo == 0xFF) {
rvi->cargo_type = CT_INVALID;
+ } else {
grfmsg(2, "RoadVehicleChangeInfo: Invalid cargo type %d, using first refittable", cargo);
}
} break;
@@ -849,6 +853,8 @@ static bool ShipVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
if (cargo < NUM_CARGO && HasBit(_cargo_mask, cargo)) {
svi->cargo_type = cargo;
+ } else if (cargo == 0xFF) {
+ svi->cargo_type = CT_INVALID;
} else {
svi->cargo_type = CT_INVALID;
grfmsg(2, "ShipVehicleChangeInfo: Invalid cargo type %d, using first refittable", cargo);