1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 09:09:09 +00:00

Codechange: Remove min/max functions in favour of STL variants (#8502)

This commit is contained in:
Charles Pigott
2021-01-08 10:16:18 +00:00
committed by GitHub
parent c1fddb9a6a
commit 9b800a96ed
181 changed files with 900 additions and 954 deletions

View File

@@ -940,8 +940,8 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object,
if (totalsets == 0) return nullptr;
uint set = (v->cargo.StoredCount() * totalsets) / max((uint16)1, v->cargo_cap);
set = min(set, totalsets - 1);
uint set = (v->cargo.StoredCount() * totalsets) / std::max<uint16>(1u, v->cargo_cap);
set = std::min(set, totalsets - 1);
return in_motion ? group->loaded[set] : group->loading[set];
}