aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-06-06 19:45:57 +0530
committerEugene Sandulenko2019-09-03 17:16:43 +0200
commit95234eef3b1957c3d932a0939f60bff6436d3392 (patch)
tree18c710bfe1857e3ff611a8c4c4acc27ac03cce70
parent12a9036dd66bd31d77f99a4b63b60ac49eef9453 (diff)
downloadscummvm-rg350-95234eef3b1957c3d932a0939f60bff6436d3392.tar.gz
scummvm-rg350-95234eef3b1957c3d932a0939f60bff6436d3392.tar.bz2
scummvm-rg350-95234eef3b1957c3d932a0939f60bff6436d3392.zip
HDB: Add ScriptPatches for setglobal function
-rw-r--r--engines/hdb/lua-script.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp
index c39ae4a11a..82b40a17a9 100644
--- a/engines/hdb/lua-script.cpp
+++ b/engines/hdb/lua-script.cpp
@@ -35,6 +35,8 @@ struct ScriptPatch {
const char* replace;
} scriptPatches[] = {
{"GLOBAL_LUA", "for i,npc in npcs do", "for i,npc in pairs(npcs) do"},
+ {"GLOBAL_LUA", "setglobal( npcdef.codename..\"_init\", function() return NPC_Init( npcdef ) end )", "npcdef.codename..\"_init\" = function() return NPC_Init( npcdef ) end"},
+ {"GLOBAL_LUA", "setglobal( npcdef.codename..\"_use\", function(x, y, v1, v2) return NPC_Use( npcdef, x, y, v1, v2 ) end )", "npcdef.codename..\"_use\" = function(x, y, v1, v2) return NPC_Use( npcdef, x, y, v1, v2 ) end"},
{NULL, NULL, NULL},
};
@@ -711,7 +713,6 @@ bool LuaScript::initScript(Common::SeekableReadStream *stream, const char *scrip
return true;
}
-
bool LuaScript::executeMPC(Common::SeekableReadStream *stream, const char *name, const char *scriptName, int32 length) {
if (!_systemInit) {