aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/hdb/lua-script.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp
index 9691763afa..edd47bc2e5 100644
--- a/engines/hdb/lua-script.cpp
+++ b/engines/hdb/lua-script.cpp
@@ -860,12 +860,12 @@ bool LuaScript::initScript(Common::SeekableReadStream *stream, const char *scrip
return false;
}
+ lua_getglobal(_state, "level_init");
+
// Error handling function to be executed after the function is put on the stack
lua_rawgeti(_state, LUA_REGISTRYINDEX, _pcallErrorhandlerRegistryIndex);
lua_insert(_state, -2);
- lua_getglobal(_state, "level_init");
-
if (lua_pcall(_state, 0, 0, -2)) {
error("An error occured while executing \"%s\": %s.", "level_init", lua_tostring(_state, -1));
lua_pop(_state, -1);