mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-11 08:49:50 +00:00
Cleanup: No need to cound actual cargo to get scroll count.
This commit is contained in:
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
Block a user