summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-02-28 17:18:36 +0000
committermaedhros <maedhros@openttd.org>2007-02-28 17:18:36 +0000
commitaadd8a4b44e0f67e5a2ccb685a56fc258c1eb9ff (patch)
tree1d7abddc5b0568b06084eb248dba4886fdc92637 /src/economy.cpp
parentf865f0a44550f0433495e494c66928d4e9a82aad (diff)
downloadopenttd-aadd8a4b44e0f67e5a2ccb685a56fc258c1eb9ff.tar.xz
(svn r8945) -Codechange: Rename v->load_status to v->vehicle_flags so it can be used for more than just the gradual loading status.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 41bcc4237..24e4c9515 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1352,7 +1352,7 @@ int LoadUnloadVehicle(Vehicle *v, bool just_arrived)
* there is nothing left to load. It's easier to clear this if the
* conditions haven't been met than attempting to check them all before
* enabling though. */
- SETBIT(v->load_status, LS_LOADING_FINISHED);
+ SETBIT(v->vehicle_flags, VF_LOADING_FINISHED);
old_player = _current_player;
_current_player = v->owner;
@@ -1371,16 +1371,16 @@ int LoadUnloadVehicle(Vehicle *v, bool just_arrived)
if (v->cargo_cap == 0) continue;
/* If the vehicle has just arrived, set it to unload. */
- if (just_arrived) SETBIT(v->load_status, LS_CARGO_UNLOADING);
+ if (just_arrived) SETBIT(v->vehicle_flags, VF_CARGO_UNLOADING);
ge = &st->goods[v->cargo_type];
count = GB(ge->waiting_acceptance, 0, 12);
/* unload? */
- if (v->cargo_count != 0 && HASBIT(v->load_status, LS_CARGO_UNLOADING)) {
+ if (v->cargo_count != 0 && HASBIT(v->vehicle_flags, VF_CARGO_UNLOADING)) {
uint16 amount_unloaded = _patches.gradual_loading ? min(v->cargo_count, load_amount) : v->cargo_count;
- CLRBIT(u->load_status, LS_LOADING_FINISHED);
+ CLRBIT(u->vehicle_flags, VF_LOADING_FINISHED);
if (v->cargo_source != last_visited && ge->waiting_acceptance & 0x8000 && !(u->current_order.flags & OF_TRANSFER)) {
/* deliver goods to the station */
@@ -1442,8 +1442,8 @@ int LoadUnloadVehicle(Vehicle *v, bool just_arrived)
}
/* The vehicle must have been unloaded because it is either empty, or
- * the UNLOADING bit is already clear in v->load_status. */
- CLRBIT(v->load_status, LS_CARGO_UNLOADING);
+ * the UNLOADING bit is already clear in v->vehicle_flags. */
+ CLRBIT(v->vehicle_flags, VF_CARGO_UNLOADING);
/* We cannot have paid for more cargo than there is on board. */
assert(v->cargo_paid_for <= v->cargo_count);
@@ -1488,7 +1488,7 @@ int LoadUnloadVehicle(Vehicle *v, bool just_arrived)
if (cap > count) cap = count;
if (_patches.gradual_loading) cap = min(cap, load_amount);
- if (cap < count) CLRBIT(u->load_status, LS_LOADING_FINISHED);
+ if (cap < count) CLRBIT(u->vehicle_flags, VF_LOADING_FINISHED);
cargoshare = cap * 10000 / ge->waiting_acceptance;
feeder_profit_share = ge->feeder_profit * cargoshare / 10000;
v->cargo_count += cap;
@@ -1515,7 +1515,7 @@ int LoadUnloadVehicle(Vehicle *v, bool just_arrived)
uint gradual_loading_wait_time[] = { 40, 20, 10, 20 };
unloading_time = gradual_loading_wait_time[v->type];
- if (HASBIT(v->load_status, LS_LOADING_FINISHED)) {
+ if (HASBIT(v->vehicle_flags, VF_LOADING_FINISHED)) {
if (anything_loaded) {
unloading_time += 20;
} else {