fix: compatiblity with unpack and table.unpack (#155)

In Lua 5.2 the unpack global has been moved to table.unpack
To keep compatiblity with 5.1 and newer, choose depending on what's
available.
This commit is contained in:
christoph-heinrich
2022-08-31 17:20:33 +02:00
committed by GitHub
parent 6eb48fa571
commit ad2123744b

View File

@@ -3543,7 +3543,7 @@ mp.register_script_message('show-menu', function(json)
if type(value) == 'string' then
mp.command(value)
else
mp.commandv(table.unpack(value))
mp.commandv((unpack or table.unpack)(value))
end
end