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:
@@ -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];
|
||||
}
|
||||
|
Reference in New Issue
Block a user