From 3a73d47351952d0447c045c1294f37db3bb2dc19 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 4 Jul 2007 22:18:33 +0000 Subject: (svn r10440) -Fix: CBM_IND defines bits to be set, not bitsets. --- src/economy.cpp | 6 ++---- src/newgrf_industries.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src') 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; -- cgit v1.2.3-54-g00ecf