mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-23 17:20:22 +01:00
mob alias now transfers staticdata (thanks MoNTE48)
This commit is contained in:
parent
c5b74230e5
commit
92ab4eeb2e
10
api.lua
10
api.lua
@ -6,7 +6,7 @@ local use_cmi = minetest.global_exists("cmi")
|
||||
|
||||
mobs = {
|
||||
mod = "redo",
|
||||
version = "20200112",
|
||||
version = "20200123",
|
||||
intllib = S,
|
||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||
}
|
||||
@ -4267,13 +4267,17 @@ function mobs:alias_mob(old_name, new_name)
|
||||
|
||||
physical = false,
|
||||
|
||||
on_activate = function(self)
|
||||
on_activate = function(self, staticdata)
|
||||
|
||||
if minetest.registered_entities[new_name] then
|
||||
minetest.add_entity(self.object:get_pos(), new_name)
|
||||
minetest.add_entity(self.object:get_pos(), new_name, staticdata)
|
||||
end
|
||||
|
||||
self.object:remove()
|
||||
end,
|
||||
|
||||
get_staticdata = function(self)
|
||||
return self
|
||||
end
|
||||
})
|
||||
end
|
||||
|
2
api.txt
2
api.txt
@ -750,7 +750,7 @@ mobs:register_mob("mob_horse:horse", {
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker.getpos(), "mobs:saddle")
|
||||
minetest.add_item(clicker.get_pos(), "mobs:saddle")
|
||||
end
|
||||
|
||||
-- attach player to horse
|
||||
|
Loading…
Reference in New Issue
Block a user