diff --git a/utils/debug.lua b/utils/debug.lua index f56b1349..35a7d509 100644 --- a/utils/debug.lua +++ b/utils/debug.lua @@ -68,6 +68,16 @@ function Debug.print(message, trace_levels) log(message) end +--- Returns the factorio LuaObject type or the Lua data type +-- @param object +function Debug.object_type(object) + local obj_type = type(object) + if obj_type == 'table' and object.isluaobject then + return match(object.help(),'Lua%a+') + end + return obj_type +end + ---Shows the given message if debug is on. ---@param position Position ---@param message string