1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2024-11-14 06:20:18 +01:00

backup existing vars into initial_properties for future compatibility

This commit is contained in:
tenplus1 2023-09-30 11:30:51 +01:00
parent ca2758622c
commit da54b9e141
2 changed files with 22 additions and 4951 deletions

23
api.lua
View File

@ -11,7 +11,7 @@ local use_mc2 = minetest.get_modpath("mcl_core")
-- Global
mobs = {
mod = "redo",
version = "20230927",
version = "20230930",
translate = S,
invis = minetest.global_exists("invisibility") and invisibility or {},
node_snow = minetest.registered_aliases["mapgen_snow"]
@ -3127,6 +3127,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

File diff suppressed because it is too large Load Diff