diff options
author | rubidium <rubidium@openttd.org> | 2007-07-04 22:18:33 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-07-04 22:18:33 +0000 |
commit | 997871063fb08e5bc87c09ed967b50562597b87d (patch) | |
tree | e8c5f707880ebbaa4799af80578040dfbd6fad46 /src | |
parent | 1bdb72ebd42cf18972b67b2bf73086d6fda47693 (diff) | |
download | openttd-997871063fb08e5bc87c09ed967b50562597b87d.tar.xz |
(svn r10440) -Fix: CBM_IND defines bits to be set, not bitsets.
Diffstat (limited to 'src')
-rw-r--r-- | src/economy.cpp | 6 | ||||
-rw-r--r-- | src/newgrf_industries.cpp | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index c2c677dab..cf47eab31 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1237,11 +1237,9 @@ static void DeliverGoodsToIndustry(TileIndex xy, CargoID cargo_type, int num_pie 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); diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index 8e0ba446d..bbd561b9f 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -123,7 +123,7 @@ uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte par 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; |