summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-05-25 21:55:47 +0000
committeryexo <yexo@openttd.org>2009-05-25 21:55:47 +0000
commit7425bf779d8bd989d51f3844c5e70bbe352962cc (patch)
tree671c5529d9e8fb8ec5449e091b2d322e89cd5097 /src/script
parent9355d1d16981a7a0803aae1f1103900fea095bca (diff)
downloadopenttd-7425bf779d8bd989d51f3844c5e70bbe352962cc.tar.xz
(svn r16425) -Change [FS#2869]: Stop an AI when it takes too long to initialize or load
Diffstat (limited to 'src/script')
-rw-r--r--src/script/squirrel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp
index f31b813da..6737fd3ef 100644
--- a/src/script/squirrel.cpp
+++ b/src/script/squirrel.cpp
@@ -209,7 +209,7 @@ bool Squirrel::CallMethod(HSQOBJECT instance, const char *method_name, HSQOBJECT
if (ret != NULL) sq_getstackobj(vm, -1, ret);
/* Reset the top, but don't do so for the AI main function, as we need
* a correct stack when resuming. */
- if (suspend == -1) sq_settop(this->vm, top);
+ if (!this->IsSuspended()) sq_settop(this->vm, top);
/* Restore the return-value location. */
this->vm->_suspended_target = last_target;