Mercurial > hg > openttd
changeset 6280:73d35d062702 draft
(svn r9092) -Codechange: (NewGRF) (re r8885) Also set cargo type as invalid if the chosen type is not available in the current climate.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Sat, 10 Mar 2007 09:23:33 +0000 |
parents | 33440a3285aa |
children | 027018edadd1 |
files | src/newgrf.cpp |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -365,7 +365,7 @@ FOR_EACH_OBJECT { uint8 ctype = grf_load_byte(&buf); - if (ctype < NUM_CARGO) { + if (ctype < NUM_CARGO && HASBIT(_cargo_mask, ctype)) { rvi[i].cargo_type = ctype; } else { rvi[i].cargo_type = CT_INVALID; @@ -557,7 +557,7 @@ FOR_EACH_OBJECT { uint8 cargo = grf_load_byte(&buf); - if (cargo < NUM_CARGO) { + if (cargo < NUM_CARGO && HASBIT(_cargo_mask, cargo)) { rvi[i].cargo_type = cargo; } else { rvi[i].cargo_type = CT_INVALID; @@ -671,7 +671,7 @@ FOR_EACH_OBJECT { uint8 cargo = grf_load_byte(&buf); - if (cargo < NUM_CARGO) { + if (cargo < NUM_CARGO && HASBIT(_cargo_mask, cargo)) { svi[i].cargo_type = cargo; } else { svi[i].cargo_type = CT_INVALID;