mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-04 21:33:51 +00:00
(svn r18038) -Fix [FS#3290] (r17402): AIs failed to load their data from savegames by crashing them when they tried
This commit is contained in:
parent
dd28ddfd9f
commit
6cfeb1920f
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user