Mercurial > hg > openttd
changeset 13519:e3540ce3430f draft
(svn r18038) -Fix [FS#3290] (r17402): AIs failed to load their data from savegames by crashing them when they tried
author | rubidium <rubidium@openttd.org> |
---|---|
date | Wed, 11 Nov 2009 18:13:17 +0000 |
parents | 2564e17da6cb |
children | 8ab9179e0f86 |
files | src/script/squirrel.cpp |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -229,7 +229,7 @@ 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;