From 23a48b2815c6cea2857cd44748f4e9eec42658c5 Mon Sep 17 00:00:00 2001 From: celestar Date: Mon, 18 Aug 2008 16:52:40 +0000 Subject: (svn r14098) -Fix: Make the 'Transfer Credit' display aware of the entire consist, not only the first vehicle --- src/train_gui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/train_gui.cpp') 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); } } -- cgit v1.2.3-54-g00ecf