forked from VoxeLibre/VoxeLibre
Check object on mob tranformation
This commit is contained in:
parent
468b46a920
commit
41055d5abe
|
@ -600,10 +600,12 @@ function mcl_util.get_object_name(object)
|
||||||
end
|
end
|
||||||
|
|
||||||
function mcl_util.replace_mob(obj, mob)
|
function mcl_util.replace_mob(obj, mob)
|
||||||
|
if not obj then return end
|
||||||
local rot = obj:get_yaw()
|
local rot = obj:get_yaw()
|
||||||
local pos = obj:get_pos()
|
local pos = obj:get_pos()
|
||||||
obj:remove()
|
obj:remove()
|
||||||
obj = minetest.add_entity(pos, mob)
|
obj = minetest.add_entity(pos, mob)
|
||||||
|
if not obj then return end
|
||||||
obj:set_yaw(rot)
|
obj:set_yaw(rot)
|
||||||
return obj
|
return obj
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue