diff options
author | Nipun Garg | 2019-06-06 02:58:11 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:43 +0200 |
commit | 431d819d08bc1972a65acf18bbdb647674c18e9a (patch) | |
tree | 23cd371ee84e247569ee8b2b0986f9450dba0ddc | |
parent | 7dd8b07cebeb76d02953c2bf40001ca65092439a (diff) | |
download | scummvm-rg350-431d819d08bc1972a65acf18bbdb647674c18e9a.tar.gz scummvm-rg350-431d819d08bc1972a65acf18bbdb647674c18e9a.tar.bz2 scummvm-rg350-431d819d08bc1972a65acf18bbdb647674c18e9a.zip |
HDB: Load GLOBAL_LUA in initScript
-rw-r--r-- | engines/hdb/lua-script.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index 2feb6cd22e..df6d874a89 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -620,21 +620,25 @@ bool LuaScript::initScript(Common::SeekableReadStream *stream, const char *name, spawn names into Lua once they are implemented. */ - /* - TODO: Find what from where the global.lua - is to be loaded, and execute it. - */ + // Load GLOBAL_LUA and execute it + g_hdb->fileMan->findFirstData("GLOBAL_LUA", TYPE_BINARY); + + //if (!executeMPC(globalStream, "global code", globalLength)) { + // error("LuaScript::initScript: 'global code' failed to execute"); + // return false; + //} + // Load script and execute it if (!executeMPC(stream, "level code", length)) { error("LuaScript::initScript: 'level code' failed to execute"); return false; } - + lua_getglobal(_state, "level_init"); lua_pcall(_state, 0, 0, 0); - + return true; } |