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