fix a bunch of bugs. still need to do more work on the station/circular saw distinction

This commit is contained in:
flux
2022-06-17 12:22:47 -07:00
parent 21d4fab1f5
commit 21f36e6c1c
10 changed files with 60 additions and 17 deletions

View File

@ -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
}