mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-04-15 20:25:16 +02:00
Fix crash when hostile mobs are disabled (#4989)
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4989 Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land> Co-authored-by: teknomunk <teknomunk@protonmail.com> Co-committed-by: teknomunk <teknomunk@protonmail.com>
This commit is contained in:
parent
c89349251b
commit
6fab15e8df
1 changed files with 3 additions and 1 deletions
|
@ -620,11 +620,13 @@ function mcl_mobs.spawn(pos,id)
|
|||
end
|
||||
local start_time = core.get_us_time()
|
||||
local obj = core.add_entity(pos, def.name)
|
||||
if not obj then return end
|
||||
|
||||
--note = "spawned a mob"
|
||||
exclude_time = exclude_time + core.get_us_time() - start_time
|
||||
-- initialize head bone
|
||||
if def.head_swivel and def.head_bone_position then
|
||||
if obj and obj.get_bone_override then -- minetest >= 5.9
|
||||
if obj.get_bone_override then -- minetest >= 5.9
|
||||
obj:set_bone_override(def.head_swivel, {
|
||||
position = { vec = def.head_bone_position, absolute = true },
|
||||
rotation = { vec = vector.zero(), absolute = true }
|
||||
|
|
Loading…
Add table
Reference in a new issue