lua 5.2 compatibility #14

Merged
Kan18 merged 10 commits from attempt-lua52-compat into develop-1.8 2019-07-20 18:19:31 -04:00
Showing only changes of commit 1c1d2151ea - Show all commits

View File

@@ -241,7 +241,7 @@ local function _place(action, indexOrId)
if not state.digPolicy(action) then if not state.digPolicy(action) then
state.attackPolicy(action) state.attackPolicy(action)
end end
return unpack(result) return table.unpack(result)
end) end)
end end
@@ -1024,7 +1024,7 @@ function turtle.run(fn, ...)
synchronized(turtle, function() synchronized(turtle, function()
turtle.resetState() turtle.resetState()
s, m = pcall(function() fn(unpack(args)) end) s, m = pcall(function() fn(table.unpack(args)) end)
turtle.resetState() turtle.resetState()
if not s and m then if not s and m then
_G.printError(m) _G.printError(m)