mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 22:03:45 +01:00
Merge pull request 'Check object on mob (lightning) tranformation' (#2918) from fix_lightning_crash into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2918
This commit is contained in:
commit
8ad79fbeed
@ -600,10 +600,12 @@ function mcl_util.get_object_name(object)
|
||||
end
|
||||
|
||||
function mcl_util.replace_mob(obj, mob)
|
||||
if not obj then return end
|
||||
local rot = obj:get_yaw()
|
||||
local pos = obj:get_pos()
|
||||
obj:remove()
|
||||
obj = minetest.add_entity(pos, mob)
|
||||
if not obj then return end
|
||||
obj:set_yaw(rot)
|
||||
return obj
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user