mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-07-03 16:40:42 +02:00
almost done, mostly documentation left
This commit is contained in:
@ -23,6 +23,37 @@ stairsplus.util = {
|
||||
return sorted
|
||||
end,
|
||||
|
||||
table_equals = function(t1, t2)
|
||||
if t1 == t2 then
|
||||
return true
|
||||
end
|
||||
|
||||
local tt1 = type(t1)
|
||||
local tt2 = type(t2)
|
||||
|
||||
if tt1 ~= tt2 then
|
||||
return false
|
||||
end
|
||||
|
||||
if tt1 ~= "table" or tt2 ~= "table" then
|
||||
return t1 == t2
|
||||
end
|
||||
|
||||
for k1, v1 in pairs(t1) do
|
||||
if not v1 == t2[k1] then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
for k2, v2 in pairs(t2) do
|
||||
if not t1[k2] == v2 then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
|
||||
check_call = function(func)
|
||||
-- wrap a function w/ logic to avoid crashing the game
|
||||
local f = function(...)
|
||||
|
Reference in New Issue
Block a user