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
commit0d52f3b417bb5aec6fda5b588ad6d96c1c7ce40f (patch)
treee8827296f0c8c23179f92b190462bf0bf4c32d62 /src/script
parentcb7449b83cd787ae310cb93e7694477b9dfbff9e (diff)
downloadopenttd-0d52f3b417bb5aec6fda5b588ad6d96c1c7ce40f.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;
}