mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-04 11:34:22 +01:00
(svn r3394) - NewGRF fix: ignore non-climate dependent cargo types. The spec is rather vague on this, but we don't support newcargos anyway.
This commit is contained in:
parent
be288e4d1b
commit
2067b2e7b4
12
newgrf.c
12
newgrf.c
@ -308,7 +308,11 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
|
|||||||
FOR_EACH_OBJECT {
|
FOR_EACH_OBJECT {
|
||||||
uint8 ctype = grf_load_byte(&buf);
|
uint8 ctype = grf_load_byte(&buf);
|
||||||
|
|
||||||
|
if (ctype < NUM_CARGO) {
|
||||||
rvi[i].cargo_type = ctype;
|
rvi[i].cargo_type = ctype;
|
||||||
|
} else {
|
||||||
|
grfmsg(GMS_NOTICE, "RailVehicleChangeInfo: Invalid cargo type %d, ignoring.", ctype);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 0x16: { /* Weight */
|
case 0x16: { /* Weight */
|
||||||
@ -492,7 +496,11 @@ static bool RoadVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
|
|||||||
FOR_EACH_OBJECT {
|
FOR_EACH_OBJECT {
|
||||||
uint8 cargo = grf_load_byte(&buf);
|
uint8 cargo = grf_load_byte(&buf);
|
||||||
|
|
||||||
|
if (cargo < NUM_CARGO) {
|
||||||
rvi[i].cargo_type = cargo;
|
rvi[i].cargo_type = cargo;
|
||||||
|
} else {
|
||||||
|
grfmsg(GMS_NOTICE, "RoadVehicleChangeInfo: Invalid cargo type %d, ignoring.", cargo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 0x11: { /* Cost factor */
|
case 0x11: { /* Cost factor */
|
||||||
@ -610,7 +618,11 @@ static bool ShipVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
|
|||||||
// assume otherwise.
|
// assume otherwise.
|
||||||
cargo = local_cargo_id_ctype[cargo];
|
cargo = local_cargo_id_ctype[cargo];
|
||||||
#endif
|
#endif
|
||||||
|
if (cargo < NUM_CARGO) {
|
||||||
svi[i].cargo_type = cargo;
|
svi[i].cargo_type = cargo;
|
||||||
|
} else {
|
||||||
|
grfmsg(GMS_NOTICE, "ShipVehicleChangeInfo: Invalid cargo type %d, ignoring.", cargo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 0x0D: { /* Cargo capacity */
|
case 0x0D: { /* Cargo capacity */
|
||||||
|
Loading…
Reference in New Issue
Block a user