mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-07-03 16:40:42 +02:00
fix a bunch of bugs. still need to do more work on the station/circular saw distinction
This commit is contained in:
@ -21,5 +21,20 @@ stairsplus.util = {
|
||||
table.sort(sorted)
|
||||
end
|
||||
return sorted
|
||||
end,
|
||||
|
||||
check_call = function(func)
|
||||
-- wrap a function w/ logic to avoid crashing the game
|
||||
local f = function(...)
|
||||
local status, out = pcall(func, ...)
|
||||
if status then
|
||||
return out
|
||||
else
|
||||
local message = ("Error (func): %s %s"):format(out, dump({...}))
|
||||
stairsplus.log("error", message)
|
||||
error(message)
|
||||
end
|
||||
end
|
||||
return f
|
||||
end
|
||||
}
|
||||
|
Reference in New Issue
Block a user