summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-12-15 01:38:55 +0000
committerrubidium <rubidium@openttd.org>2009-12-15 01:38:55 +0000
commit7c2a61e2107eb5bd3d680128c1eea22650f70bdf (patch)
treeac3d09b0afe8dec2634ae7ece76321adaff4a8e2 /src/core
parent619e70f94a459954b4ba1c6e41921d4d9813cb45 (diff)
downloadopenttd-7c2a61e2107eb5bd3d680128c1eea22650f70bdf.tar.xz
(svn r18508) -Fix [FS#3372]: if a rail station class had less data than capacity it would try to set a negative position
Diffstat (limited to 'src/core')
-rw-r--r--src/core/math_func.hpp1
1 files changed, 1 insertions, 0 deletions
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 <typename T>
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;