diff options
author | alberth <alberth@openttd.org> | 2014-09-18 19:50:41 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2014-09-18 19:50:41 +0000 |
commit | 4ff3ab1357a8d169379fe41e77ae8ae59a539047 (patch) | |
tree | 8c365f3f4769ae07bb47ab614d78bbf929ef6ad7 /src | |
parent | dfbcd8869df0627dc5ff2ee83aed00bc323e740b (diff) | |
download | openttd-4ff3ab1357a8d169379fe41e77ae8ae59a539047.tar.xz |
(svn r26848) -Codechange: Unduplicate summing of cargo capacities in GetTotalCapacityOfArticulatedParts.
Diffstat (limited to 'src')
-rw-r--r-- | src/engine_gui.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 3ac261d15..0e5324868 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -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) |