summaryrefslogtreecommitdiff
path: root/src/3rdparty
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-07-16 17:42:58 +0000
committerrubidium <rubidium@openttd.org>2010-07-16 17:42:58 +0000
commit92da292fbc3fe4a3c2c7c124168fa77653210b53 (patch)
tree28aadd607f11b560e2471ef8dfbea6ce9e6ae876 /src/3rdparty
parent50c7f60eca6da0f710084da9d4ecf1ae9217498b (diff)
downloadopenttd-92da292fbc3fe4a3c2c7c124168fa77653210b53.tar.xz
(svn r20162) -Fix [FS#3954]: integer comparison failed in case the difference was more than "MAX_UINT"/2
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp
index 5a2afe2a1..1dbd83f30 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp
@@ -186,7 +186,8 @@ bool SQVM::ObjCmp(const SQObjectPtr &o1,const SQObjectPtr &o2,SQInteger &result)
case OT_STRING:
_RET_SUCCEED(scstrcmp(_stringval(o1),_stringval(o2)));
case OT_INTEGER:
- _RET_SUCCEED(_integer(o1)-_integer(o2));
+ /* FS#3954: wrong integer comparison */
+ _RET_SUCCEED((_integer(o1)<_integer(o2))?-1:(_integer(o1)==_integer(o2))?0:1);
case OT_FLOAT:
_RET_SUCCEED((_float(o1)<_float(o2))?-1:1);
case OT_TABLE: