summaryrefslogtreecommitdiff
path: root/src/train_gui.cpp
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2008-08-18 16:52:40 +0000
committercelestar <celestar@openttd.org>2008-08-18 16:52:40 +0000
commit23a48b2815c6cea2857cd44748f4e9eec42658c5 (patch)
tree5b0ecf13a8ec0041ff1289769acbddf67dda4426 /src/train_gui.cpp
parent99efe9aaae2f7d6d39ab694e0be9981b738661ec (diff)
downloadopenttd-23a48b2815c6cea2857cd44748f4e9eec42658c5.tar.xz
(svn r14098) -Fix: Make the 'Transfer Credit' display aware of the entire consist, not only the first vehicle
Diffstat (limited to 'src/train_gui.cpp')
-rw-r--r--src/train_gui.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp
index 715263a13..d97ef36de 100644
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -231,6 +231,7 @@ void DrawTrainDetails(const Vehicle *v, int x, int y, int vscroll_pos, uint16 vs
} else {
AcceptedCargo act_cargo;
AcceptedCargo max_cargo;
+ Money feeder_share = 0;
memset(max_cargo, 0, sizeof(max_cargo));
memset(act_cargo, 0, sizeof(act_cargo));
@@ -238,6 +239,7 @@ void DrawTrainDetails(const Vehicle *v, int x, int y, int vscroll_pos, uint16 vs
for (const Vehicle *u = v; u != NULL ; u = u->Next()) {
act_cargo[u->cargo_type] += u->cargo.Count();
max_cargo[u->cargo_type] += u->cargo_cap;
+ feeder_share += u->cargo.FeederShare();
}
/* draw total cargo tab */
@@ -253,7 +255,7 @@ void DrawTrainDetails(const Vehicle *v, int x, int y, int vscroll_pos, uint16 vs
DrawString(x, y + 2, FreightWagonMult(i) > 1 ? STR_TOTAL_CAPACITY_MULT : STR_TOTAL_CAPACITY, TC_FROMSTRING);
}
}
- SetDParam(0, v->cargo.FeederShare());
+ SetDParam(0, feeder_share);
DrawString(x, y + 15, STR_FEEDER_CARGO_VALUE, TC_FROMSTRING);
}
}