summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2014-01-12 17:44:55 +0000
committerfonsinchen <fonsinchen@openttd.org>2014-01-12 17:44:55 +0000
commit9ad173c9ccc5e223c4d326837ffae3aa6d7cb9ff (patch)
tree1d81179dab2dd48dc495a6b5593ea9dbb8a493cc
parent8259d279d552842f55704dda586916b7e53b943c (diff)
downloadopenttd-9ad173c9ccc5e223c4d326837ffae3aa6d7cb9ff.tar.xz
(svn r26236) -Fix: Don't overreserve after autorefit, but do reserve mail for aircraft
-rw-r--r--src/economy.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 562f42af5..dcf228111 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1427,12 +1427,14 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station
/* Add new capacity to consist capacity and reserve cargo */
w = v_start;
do {
- st->goods[w->cargo_type].cargo.Reserve(w->cargo_cap, &w->cargo, st->xy, next_station);
+ st->goods[w->cargo_type].cargo.Reserve(w->cargo_cap - w->cargo.RemainingCount(), &w->cargo, st->xy, next_station);
consist_capleft[w->cargo_type] += w->cargo_cap - w->cargo.RemainingCount();
w = w->HasArticulatedPart() ? w->GetNextArticulatedPart() : NULL;
} while (w != NULL);
if (is_normal_aircraft) {
- consist_capleft[v->Next()->cargo_type] += v->Next()->cargo_cap - v->Next()->cargo.RemainingCount();
+ w = v->Next();
+ st->goods[w->cargo_type].cargo.Reserve(w->cargo_cap - w->cargo.RemainingCount(), &w->cargo, st->xy, next_station);
+ consist_capleft[w->cargo_type] += w->cargo_cap - w->cargo.RemainingCount();
}
cur_company.Restore();