summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorYexo <Yexo@openttd.org>2009-01-22 02:01:07 +0000
committerYexo <Yexo@openttd.org>2009-01-22 02:01:07 +0000
commitb2bfa2115548183acca1854747abd8d84aa2ca4a (patch)
treee8827296f0c8c23179f92b190462bf0bf4c32d62 /src/script
parent500356f784933bb0771ce1e8d57d122b87259ebf (diff)
downloadopenttd-b2bfa2115548183acca1854747abd8d84aa2ca4a.tar.xz
(svn r15204) -Fix (r15167): The check was a bit too restrictive, the top of the stack needs to be resetted if another function is called while the AI is running but not suspended.
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 22e39562e..aa3344ea2 100644
--- a/src/script/squirrel.cpp
+++ b/src/script/squirrel.cpp
@@ -194,7 +194,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 (this->vm->_suspended == 0) sq_settop(this->vm, top);
+ if (suspend == -1) sq_settop(this->vm, top);
return this->vm->_suspended != 0;
}