clean aliased mob staticdata

This commit is contained in:
tenplus1 2022-12-22 13:19:24 +00:00
parent 86b6a1a950
commit bbd7a08591

20
api.lua
View File

@ -25,7 +25,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = { mobs = {
mod = "redo", mod = "redo",
version = "20221213", version = "20221222",
intllib = S, intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {} invis = minetest.global_exists("invisibility") and invisibility or {}
} }
@ -4830,7 +4830,23 @@ function mobs:alias_mob(old_name, new_name)
end, end,
get_staticdata = function(self) get_staticdata = function(self)
return self
local tmp, t = {}
for _,stat in pairs(self) do
t = type(stat)
if t ~= "function"
and t ~= "nil"
and t ~= "userdata"
and _ ~= "object"
and _ ~= "_cmi_components" then
tmp[_] = self[_]
end
end
return minetest.serialize(tmp)
end end
}) })
end end