mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
Prevent error loops in xpcall.
This commit is contained in:
parent
c4986eeb82
commit
009e51b288
@ -99,8 +99,16 @@ sandbox = {
|
|||||||
tostring = tostring,
|
tostring = tostring,
|
||||||
type = type,
|
type = type,
|
||||||
_VERSION = "Lua 5.2",
|
_VERSION = "Lua 5.2",
|
||||||
xpcall = function(...)
|
xpcall = function(f, msgh, ...)
|
||||||
local result = table.pack(xpcall(...))
|
local handled = false
|
||||||
|
local result = table.pack(xpcall(f, function(...)
|
||||||
|
if handled then
|
||||||
|
return ...
|
||||||
|
else
|
||||||
|
handled = true
|
||||||
|
return msgh(...)
|
||||||
|
end
|
||||||
|
end, ...))
|
||||||
checkDeadline()
|
checkDeadline()
|
||||||
return table.unpack(result, 1, result.n)
|
return table.unpack(result, 1, result.n)
|
||||||
end,
|
end,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user