From 924241cf2a83b44c3e6d11215f3eb14f4a7dd831 Mon Sep 17 00:00:00 2001 From: lolbot-iichan Date: Wed, 22 May 2019 03:25:24 +0300 Subject: 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 --- engines/wintermute/base/scriptables/script.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3