summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-11 18:13:17 +0000
committerrubidium <rubidium@openttd.org>2009-11-11 18:13:17 +0000
commit6cfeb1920f61f15620fa7be6431e1214efa78b72 (patch)
tree615926ac78ffe805b89546c11b34037c8dc0c063 /src/script
parentdd28ddfd9f3161ba660de1bacfe51774e1abc7dd (diff)
downloadopenttd-6cfeb1920f61f15620fa7be6431e1214efa78b72.tar.xz
(svn r18038) -Fix [FS#3290] (r17402): AIs failed to load their data from savegames by crashing them when they tried
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 67a927bbe..090df3304 100644
--- a/src/script/squirrel.cpp
+++ b/src/script/squirrel.cpp
@@ -229,7 +229,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 (suspend == -1 || !this->IsSuspended()) sq_settop(this->vm, top);
/* Restore the return-value location. */
this->vm->_suspended_target = last_target;