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:
parent
ca2758622c
commit
da54b9e141
23
api.lua
23
api.lua
|
@ -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
|
||||
|
||||
|
|
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