summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-10 10:18:03 +0000
committerrubidium <rubidium@openttd.org>2008-04-10 10:18:03 +0000
commit6379c30d267215da7c1371f4d5688cd92831496f (patch)
treef1e81a713f50ffd83601dcff9cd89386c310bad6 /src/economy.cpp
parent3974bf2199cd0d55f5e37a5cbc21cefdc6f6b18c (diff)
downloadopenttd-6379c30d267215da7c1371f4d5688cd92831496f.tar.xz
(svn r12650) -Feature: ability to force a vehicle to not load at a station.
-Feature: ability to force a vehicle to not unload at a station.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 53115d448..34448af5f 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1473,7 +1473,7 @@ void VehiclePayment(Vehicle *front_v)
for (Vehicle *v = front_v; v != NULL; v = v->Next()) {
/* No cargo to unload */
- if (v->cargo_cap == 0 || v->cargo.Empty()) continue;
+ if (v->cargo_cap == 0 || v->cargo.Empty() || front_v->current_order.GetUnloadType() & OUFB_NO_UNLOAD) continue;
/* All cargo has already been paid for, no need to pay again */
if (!v->cargo.UnpaidCargo()) {
@@ -1599,7 +1599,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
GoodsEntry *ge = &st->goods[v->cargo_type];
- if (HasBit(v->vehicle_flags, VF_CARGO_UNLOADING)) {
+ if (HasBit(v->vehicle_flags, VF_CARGO_UNLOADING) && (u->current_order.GetUnloadType() & OUFB_NO_UNLOAD) == 0) {
uint cargo_count = v->cargo.Count();
uint amount_unloaded = _patches.gradual_loading ? min(cargo_count, load_amount) : cargo_count;
bool remaining; // Are there cargo entities in this vehicle that can still be unloaded here?
@@ -1638,7 +1638,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
}
/* Do not pick up goods that we unloaded */
- if (u->current_order.GetUnloadType() & OUFB_UNLOAD) continue;
+ if ((u->current_order.GetUnloadType() & OUFB_UNLOAD) || (u->current_order.GetLoadType() & OLFB_NO_LOAD)) continue;
/* update stats */
int t;