summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-12 23:35:10 +0000
committerrubidium <rubidium@openttd.org>2007-06-12 23:35:10 +0000
commit031565527e7b5f625baaae6e4626bbef0b228aad (patch)
tree12915793b97144e0e005726a4f163743c8c75650 /src
parent2f5c49abc294b249e524bee85fa996b121b34b55 (diff)
downloadopenttd-031565527e7b5f625baaae6e4626bbef0b228aad.tar.xz
(svn r10125) -Fix [FS#865]: under some circumstances the wagons of a train didn't get loaded properly.
Diffstat (limited to 'src')
-rw-r--r--src/economy.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 967373c73..47ee5c883 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1395,9 +1395,11 @@ void VehiclePayment(Vehicle *front_v)
/* No cargo to unload */
if (v->cargo_cap == 0 || v->cargo_count == 0) continue;
- SETBIT(v->vehicle_flags, VF_CARGO_UNLOADING);
/* All cargo has already been paid for, no need to pay again */
- if (v->cargo_count == v->cargo_paid_for) continue;
+ if (v->cargo_count == v->cargo_paid_for) {
+ SETBIT(v->vehicle_flags, VF_CARGO_UNLOADING);
+ continue;
+ }
GoodsEntry *ge = &st->goods[v->cargo_type];
@@ -1416,6 +1418,8 @@ void VehiclePayment(Vehicle *front_v)
v->cargo_feeder_share = 0; // clear transfer cost per vehicle
result |= 1;
+
+ SETBIT(v->vehicle_flags, VF_CARGO_UNLOADING);
} else if (front_v->current_order.flags & (OF_UNLOAD | OF_TRANSFER)) {
if ((front_v->current_order.flags & OF_TRANSFER) != 0) {
virtual_profit = GetTransportedGoodsIncome(
@@ -1437,6 +1441,8 @@ void VehiclePayment(Vehicle *front_v)
v->cargo_paid_for = v->cargo_count; // record how much of the cargo has been paid for to eliminate double counting
}
result |= 2;
+
+ SETBIT(v->vehicle_flags, VF_CARGO_UNLOADING);
}
}