From 7c2a61e2107eb5bd3d680128c1eea22650f70bdf Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 15 Dec 2009 01:38:55 +0000 Subject: (svn r18508) -Fix [FS#3372]: if a rail station class had less data than capacity it would try to set a negative position --- src/core/math_func.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/core/math_func.hpp') diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp index 48690ec58..e0b9dbc89 100644 --- a/src/core/math_func.hpp +++ b/src/core/math_func.hpp @@ -150,6 +150,7 @@ static FORCEINLINE T *AlignPtr(T *x, uint n) template static FORCEINLINE T Clamp(const T a, const T min, const T max) { + assert(min <= max); if (a <= min) return min; if (a >= max) return max; return a; -- cgit v1.2.3-54-g00ecf