summaryrefslogtreecommitdiff
path: root/economy.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-10-11 13:54:21 +0000
committertron <tron@openttd.org>2005-10-11 13:54:21 +0000
commit9fea263c77fedc7aa6744e83d5d57c0dc988b7cc (patch)
tree9f0604075083d2ae2a82e369ecf7a836c04021b5 /economy.c
parent6fb7381efa6a0e48c1bc1c8a49b7b70edf2b5bcf (diff)
downloadopenttd-9fea263c77fedc7aa6744e83d5d57c0dc988b7cc.tar.xz
(svn r3030) More work for GB/SB, this time concerning the waiting_acceptance attribute of stations
Diffstat (limited to 'economy.c')
-rw-r--r--economy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/economy.c b/economy.c
index 7acd051a0..8ec569d00 100644
--- a/economy.c
+++ b/economy.c
@@ -1364,7 +1364,8 @@ int LoadUnloadVehicle(Vehicle *v)
unloading_time += v->cargo_count;
- if ((t=ge->waiting_acceptance & 0xFFF) == 0) {
+ t = GB(ge->waiting_acceptance, 0, 12);
+ if (t == 0) {
// No goods waiting at station
ge->enroute_time = v->cargo_days;
ge->enroute_from = v->cargo_source;
@@ -1376,7 +1377,7 @@ int LoadUnloadVehicle(Vehicle *v)
ge->enroute_from = v->cargo_source;
}
// Update amount of waiting cargo
- ge->waiting_acceptance = (ge->waiting_acceptance &~0xFFF) | min(v->cargo_count + t, 0xFFF);
+ SB(ge->waiting_acceptance, 0, 12, min(v->cargo_count + t, 0xFFF));
ge->feeder_profit += v_profit;
u->profit_this_year += v_profit;
result |= 2;
@@ -1402,7 +1403,8 @@ int LoadUnloadVehicle(Vehicle *v)
// If there's goods waiting at the station, and the vehicle
// has capacity for it, load it on the vehicle.
- if ((count=ge->waiting_acceptance & 0xFFF) != 0 &&
+ count = GB(ge->waiting_acceptance, 0, 12);
+ if (count != 0 &&
(cap = v->cargo_cap - v->cargo_count) != 0) {
int cargoshare;
int feeder_profit_share;