mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-25 02:00:21 +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 = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20200112",
|
version = "20200123",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -4267,13 +4267,17 @@ function mobs:alias_mob(old_name, new_name)
|
|||||||
|
|
||||||
physical = false,
|
physical = false,
|
||||||
|
|
||||||
on_activate = function(self)
|
on_activate = function(self, staticdata)
|
||||||
|
|
||||||
if minetest.registered_entities[new_name] then
|
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
|
end
|
||||||
|
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
|
end,
|
||||||
|
|
||||||
|
get_staticdata = function(self)
|
||||||
|
return self
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
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
|
if inv:room_for_item("main", "mobs:saddle") then
|
||||||
inv:add_item("main", "mobs:saddle")
|
inv:add_item("main", "mobs:saddle")
|
||||||
else
|
else
|
||||||
minetest.add_item(clicker.getpos(), "mobs:saddle")
|
minetest.add_item(clicker.get_pos(), "mobs:saddle")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- attach player to horse
|
-- attach player to horse
|
||||||
|
Loading…
Reference in New Issue
Block a user