From e7c72d05808bc8276797e6b580592ab8c2ae00c9 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 20 Jun 2019 12:58:21 +0200 Subject: HDB: Fixed nu,ber of parameters when calling Lua functions --- engines/hdb/lua-script.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index 08d5f77fa6..fc10a9de54 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -811,14 +811,13 @@ bool LuaScript::initScript(Common::SeekableReadStream *stream, const char *scrip } bool LuaScript::callFunction(const char *name, int returns) { - if (!_systemInit) { return false; } lua_getglobal(_state, name); - if (lua_pcall(_state, 0, 0, -2)) { + if (lua_pcall(_state, 0, returns, -2)) { error("An error occured while executing \"%s\": %s.", name, lua_tostring(_state, -1)); lua_pop(_state, -1); -- cgit v1.2.3