(svn r26848) -Codechange: Unduplicate summing of cargo capacities in GetTotalCapacityOfArticulatedParts.

This commit is contained in:
alberth 2014-09-18 19:50:41 +00:00
parent dfbcd8869d
commit 4ff3ab1357
1 changed files with 1 additions and 7 deletions

View File

@ -142,14 +142,8 @@ void ShowEnginePreviewWindow(EngineID engine)
*/
uint GetTotalCapacityOfArticulatedParts(EngineID engine)
{
uint total = 0;
CargoArray cap = GetCapacityOfArticulatedParts(engine);
for (CargoID c = 0; c < NUM_CARGO; c++) {
total += cap[c];
}
return total;
return cap.GetSum<uint>();
}
static StringID GetTrainEngineInfoString(const Engine *e)