diff --git a/api.lua b/api.lua index 7fe69bb..a4f42e2 100644 --- a/api.lua +++ b/api.lua @@ -33,7 +33,7 @@ local use_mc2 = minetest.get_modpath("mcl_core") -- Global mobs = { mod = "redo", - version = "20230927", + version = "20230930", translate = S, intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {}, node_ice = "default:ice", @@ -2000,8 +2000,7 @@ local function is_peaceful_player(player) local player_name = player:get_player_name() -- player priv enabled - if player_name - and minetest.check_player_privs(player_name, "peaceful_player") then + if player_name and minetest.check_player_privs(player_name, "peaceful_player") then return true end end @@ -3238,6 +3237,27 @@ function mob_class:mob_staticdata() self.serialized_cmi_components = cmi.serialize_components(self._cmi_components) end + -- move existing variables to new initial_properties table for future compatibility + if not self.initial_properties then + + self.initial_properties = { + hp_max = self.hp_max, + physical = self.physical, + collisionbox = self.collisionbox, + selectionbox = self.selectionbox, + visual = self.visual, + visual_size = self.visual_size, + mesh = self.mesh, + textures = self.textures, + make_footstep_sound = self.make_footstep_sound, + stepheight = self.stepheight, + glow = self.glow, + nametag = self.nametag, + damage_texture_modifier = self.damage_texture_modifier, + infotext = self.infotext + } + end + return minetest.serialize(clean_staticdata(self)) end