From 9b800a96ed32720ff60b74e498a0e0a6351004f9 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Fri, 8 Jan 2021 10:16:18 +0000 Subject: Codechange: Remove min/max functions in favour of STL variants (#8502) --- src/newgrf_engine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/newgrf_engine.cpp') diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index efc9873af..8066ea432 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -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(1u, v->cargo_cap); + set = std::min(set, totalsets - 1); return in_motion ? group->loaded[set] : group->loading[set]; } -- cgit v1.2.3-54-g00ecf