Cleanup: No need to cound actual cargo to get scroll count.

This commit is contained in:
Peter Nelson 2023-05-23 17:19:38 +01:00 committed by PeterN
parent f177ce7c9a
commit 8931e90302

View File

@ -322,10 +322,8 @@ int GetTrainDetailsWndVScroll(VehicleID veh_id, TrainDetailsWindowTabs det_tab)
int num = 0;
if (det_tab == TDW_TAB_TOTALS) { // Total cargo tab
CargoArray act_cargo{};
CargoArray max_cargo{};
for (const Vehicle *v = Vehicle::Get(veh_id); v != nullptr; v = v->Next()) {
act_cargo[v->cargo_type] += v->cargo.StoredCount();
max_cargo[v->cargo_type] += v->cargo_cap;
}