summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-02-20 13:39:18 +0000
committeryexo <yexo@openttd.org>2009-02-20 13:39:18 +0000
commit7dc607b2d1cb042f6eb0302cd7408de1fce5dd88 (patch)
treef4f80f433bdd22ee221c54d0c141b80028a219af /src/script
parent07a37af14c6aaabfc38f1e6533fdc9f0284a55db (diff)
downloadopenttd-7dc607b2d1cb042f6eb0302cd7408de1fce5dd88.tar.xz
(svn r15531) -Fix (r15467): AIs were stopped at every error, whether they caught it or not.
Diffstat (limited to 'src/script')
-rw-r--r--src/script/squirrel.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp
index 0718f7945..a62c83418 100644
--- a/src/script/squirrel.cpp
+++ b/src/script/squirrel.cpp
@@ -62,7 +62,6 @@ void Squirrel::RunError(HSQUIRRELVM vm, const SQChar *error)
SQChar buf[1024];
scsnprintf(buf, lengthof(buf), _SC("Your script made an error: %s\n"), error);
Squirrel *engine = (Squirrel *)sq_getforeignptr(vm);
- engine->crashed = true;
SQPrintFunc *func = engine->print_func;
if (func == NULL) {
scfprintf(stderr, _SC("%s"), buf);
@@ -177,7 +176,7 @@ bool Squirrel::MethodExists(HSQOBJECT instance, const char *method_name)
bool Squirrel::Resume(int suspend)
{
assert(!this->crashed);
- sq_resumecatch(this->vm, suspend);
+ this->crashed = !sq_resumecatch(this->vm, suspend);
return this->vm->_suspended != 0;
}