mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-10 09:50:19 +01:00
backup existing vars into initial_properties for future compatibility
This commit is contained in:
parent
ca2758622c
commit
da54b9e141
23
api.lua
23
api.lua
@ -11,7 +11,7 @@ local use_mc2 = minetest.get_modpath("mcl_core")
|
|||||||
-- Global
|
-- Global
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20230927",
|
version = "20230930",
|
||||||
translate = S,
|
translate = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {},
|
invis = minetest.global_exists("invisibility") and invisibility or {},
|
||||||
node_snow = minetest.registered_aliases["mapgen_snow"]
|
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)
|
self.serialized_cmi_components = cmi.serialize_components(self._cmi_components)
|
||||||
end
|
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))
|
return minetest.serialize(clean_staticdata(self))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
4950
api_WIP.lua
4950
api_WIP.lua
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user