mirror of https://github.com/OpenTTD/OpenTTD
Cleanup: No need to cound actual cargo to get scroll count.
parent
f177ce7c9a
commit
8931e90302
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue