(svn r14098) -Fix: Make the 'Transfer Credit' display aware of the entire consist, not only the first vehicle

This commit is contained in:
celestar
2008-08-18 16:52:40 +00:00
parent 99efe9aaae
commit 23a48b2815
3 changed files with 10 additions and 3 deletions

View File

@@ -28,6 +28,7 @@
void DrawAircraftDetails(const Vehicle *v, int x, int y)
{
int y_offset = (v->Next()->cargo_cap != 0) ? -11 : 0;
Money feeder_share = 0;
for (const Vehicle *u = v ; u != NULL ; u = u->Next()) {
if (IsNormalAircraft(u)) {
@@ -53,11 +54,12 @@ void DrawAircraftDetails(const Vehicle *v, int x, int y)
SetDParam(1, cargo_count);
SetDParam(2, u->cargo.Source());
DrawString(x, y + 21 + y_offset, STR_8813_FROM, TC_FROMSTRING);
feeder_share += u->cargo.FeederShare();
}
}
}
SetDParam(0, v->cargo.FeederShare());
SetDParam(0, feeder_share);
DrawString(x, y + 33 + y_offset, STR_FEEDER_CARGO_VALUE, TC_FROMSTRING);
}