Mercurial > hg > openttd
changeset 7166:bf9443176c10 draft
(svn r10440) -Fix: CBM_IND defines bits to be set, not bitsets.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Wed, 04 Jul 2007 22:18:33 +0000 |
parents | c3b231638b80 |
children | 8cb30c91ffd4 |
files | src/economy.cpp src/newgrf_industries.cpp |
diffstat | 2 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/economy.cpp +++ b/src/economy.cpp @@ -1237,11 +1237,9 @@ uint16 callback = indspec->callback_flags; best->was_cargo_delivered = true; - if (callback & (CBM_IND_PRODUCTION_CARGO_ARRIVAL | CBM_IND_PRODUCTION_256_TICKS)) { + if (HASBIT(callback, CBM_IND_PRODUCTION_CARGO_ARRIVAL) || HASBIT(callback, CBM_IND_PRODUCTION_256_TICKS)) { best->incoming_cargo_waiting[accepted_cargo_index] = min(num_pieces + best->incoming_cargo_waiting[accepted_cargo_index], 0xFFFF); - if (callback & CBM_IND_PRODUCTION_CARGO_ARRIVAL) { - /** @todo Perform some magic */ - } + if (HASBIT(callback, CBM_IND_PRODUCTION_CARGO_ARRIVAL)) ///< @todo Perform some magic } else { best->produced_cargo_waiting[0] = min(best->produced_cargo_waiting[0] + (num_pieces * indspec->input_cargo_multiplier[accepted_cargo_index][0] / 256), 0xFFFF); best->produced_cargo_waiting[1] = min(best->produced_cargo_waiting[1] + (num_pieces * indspec->input_cargo_multiplier[accepted_cargo_index][1] / 256), 0xFFFF);
--- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -123,7 +123,7 @@ case 0x41: case 0x42: { // waiting cargo, but only if those two callback flags are set uint16 callback = indspec->callback_flags; - if (callback & (CBM_IND_PRODUCTION_CARGO_ARRIVAL | CBM_IND_PRODUCTION_256_TICKS)) { + if (HASBIT(callback, CBM_IND_PRODUCTION_CARGO_ARRIVAL) || HASBIT(callback, CBM_IND_PRODUCTION_256_TICKS)) { return max(industry->incoming_cargo_waiting[variable - 0x40], (uint16)0x7FFF); } else { return 0;