aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-06-30 04:37:24 +0530
committerEugene Sandulenko2019-09-03 17:17:06 +0200
commit428af6c972725a980f0a9fe4a15bb724ed46af18 (patch)
treef9d484140f9328c9a6f67c3a631fc7312ce472c6
parent2a9c34f95b954d9ac64d7c08a71fb79ca2b7afa2 (diff)
downloadscummvm-rg350-428af6c972725a980f0a9fe4a15bb724ed46af18.tar.gz
scummvm-rg350-428af6c972725a980f0a9fe4a15bb724ed46af18.tar.bz2
scummvm-rg350-428af6c972725a980f0a9fe4a15bb724ed46af18.zip
HDB: Add patches for deprecated Lua 4.0 calls
-rw-r--r--engines/hdb/lua-script.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp
index 464b581145..aeb629b69c 100644
--- a/engines/hdb/lua-script.cpp
+++ b/engines/hdb/lua-script.cpp
@@ -37,7 +37,13 @@ struct ScriptPatch {
{"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 )", "_G[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 )", "_G[npcdef.codename .. \"_use\"] = function(x, y, v1, v2) return NPC_Use( npcdef, x, y, v1, v2 ) end"},
+ {"GLOBAL_LUA", "if( dtable.counter < getn(dtable) ) then", "if( dtable.counter < #dtable ) then"},
+ {"GLOBAL_LUA", "if( getglobal( \"map\"..tostring(v1)..\"_complete\" ) ) then", "if( _G[\"map\"..tostring(v1)..\"_complete\"] ) then"},
+ {"GLOBAL_LUA", "closefunc = getglobal( npcdef.codename..\"_use\" )", "closefunc = _G[npcdef.codename..\"_use\"]"},
{"MAP00_LUA", "tempfunc = function() emptybed_use( %x, %y, %v1, %v2 ) end", "tempfunc = function() emptybed_use(x, y, v1, v2) end"},
+ {"MAP00_LUA", "if( getn( beds ) == 0 ) then", "if( #beds == 0 ) then"},
+ {"MAP01_LUA", "if( covert_index < getn(covert_dialog) ) then", "if( covert_index < #covert_dialog ) then"},
+ {"MAP01_LUA", "if( chiste_index < getn( chiste_dialog ) )then", "if( covert_index < #covert_dialog ) then"},
{NULL, NULL, NULL},
};