diff options
author | lolbot-iichan | 2019-05-22 03:25:24 +0300 |
---|---|---|
committer | Filippos Karapetis | 2020-01-11 18:05:39 +0200 |
commit | 924241cf2a83b44c3e6d11215f3eb14f4a7dd831 (patch) | |
tree | 04f683ad629d3e8e03199b395e9834b8e2a5dd5a | |
parent | 3f61c4b5f0707ccf68f9b88982a5c68afd6e27c4 (diff) | |
download | scummvm-rg350-924241cf2a83b44c3e6d11215f3eb14f4a7dd831.tar.gz scummvm-rg350-924241cf2a83b44c3e6d11215f3eb14f4a7dd831.tar.bz2 scummvm-rg350-924241cf2a83b44c3e6d11215f3eb14f4a7dd831.zip |
WINTERMUTE: Suppress FoxTail runtimeError on game load
FoxTail reloads in-hand items and cursor during AfterLoad by calling
wrapped Game.LoadItems() method.
This does not work in WME, as WME explicitly disables methods call at
"AfterLoad" event.
Somehow, everything seems to work fine without it. Let's supress this
error by now...
TODO: inspect actor.TakeItem and SetItemCursor for possible effects
TODO: make a fake game that calls some methods on AfterLoad, test with FoxTail engine
-rw-r--r-- | engines/wintermute/base/scriptables/script.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/wintermute/base/scriptables/script.cpp b/engines/wintermute/base/scriptables/script.cpp index c13310255d..856584fe72 100644 --- a/engines/wintermute/base/scriptables/script.cpp +++ b/engines/wintermute/base/scriptables/script.cpp @@ -29,6 +29,7 @@ #include "engines/wintermute/base/scriptables/script_value.h" #include "engines/wintermute/base/scriptables/script.h" #include "engines/wintermute/base/base_game.h" +#include "engines/wintermute/base/base_engine.h" #include "engines/wintermute/base/scriptables/script_engine.h" #include "engines/wintermute/base/scriptables/script_stack.h" #include "common/memstream.h" @@ -618,8 +619,14 @@ bool ScScript::executeInstruction() { _state = SCRIPT_WAITING_SCRIPT; _waitScript->copyParameters(_stack); } +#ifdef ENABLE_FOXTAIL + } else if (BaseEngine::instance().isFoxTail() && strcmp(methodName, "LoadItems") == 0 && strcmp(_threadEvent,"AfterLoad") == 0) { + _stack->correctParams(0); + _gameRef->LOG(0, "Method '%s' is called in unbreakable mode of '%s' event and was ignored", methodName, _threadEvent); + _stack->pushNULL(); +#endif } else { - // can call methods in unbreakable mode + // cannot call methods in unbreakable mode _stack->correctParams(0); runtimeError("Cannot call method '%s'. Ignored.", methodName); _stack->pushNULL(); |