(svn r18508) -Fix [FS#3372]: if a rail station class had less data than capacity it would try to set a negative position

This commit is contained in:
rubidium
2009-12-15 01:38:55 +00:00
parent e114b90751
commit 54ffa0e563
2 changed files with 2 additions and 1 deletions

View File

@@ -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;