From 2ac0410767683fb0e6315433f9805712cb85f5bd Mon Sep 17 00:00:00 2001 From: celestar Date: Thu, 11 Jan 2007 11:05:01 +0000 Subject: (svn r8055) -Codechange: Replace the different max, dmax, maxu whatever macros by a simple template function max(), that requires two arguments of the same type. While I'm at it change a variable called "max" to "maxval" in a function that calls max(). --- src/newgrf_engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/newgrf_engine.cpp') diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 5b0fa5179..58f1e43b6 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -832,7 +832,7 @@ static const SpriteGroup *VehicleResolveReal(const ResolverObject *object, const } else if (v->cargo_count == 0 || totalsets == 2) { set = 0; } else { - set = v->cargo_count * (totalsets - 2) / max(1, v->cargo_cap) + 1; + set = v->cargo_count * (totalsets - 2) / max((uint16)1, v->cargo_cap) + 1; } return in_motion ? group->g.real.loaded[set] : group->g.real.loading[set]; -- cgit v1.2.3-54-g00ecf