summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/economy.cpp6
-rw-r--r--src/newgrf_industries.cpp2
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;