mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-12 10:50:21 +01:00
add nil check for mob eggs
This commit is contained in:
parent
f32b69a654
commit
f576947d41
4
api.lua
4
api.lua
@ -3972,7 +3972,7 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
|
||||
|
||||
local data = itemstack:get_metadata()
|
||||
local mob = minetest.add_entity(pos, mob, data)
|
||||
local ent = mob:get_luaentity()
|
||||
local ent = mob and mob:get_luaentity()
|
||||
|
||||
if not ent then return end -- sanity check
|
||||
|
||||
@ -4020,7 +4020,7 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
|
||||
pos.y = pos.y + 1
|
||||
|
||||
local mob = minetest.add_entity(pos, mob)
|
||||
local ent = mob:get_luaentity()
|
||||
local ent = mob and mob:get_luaentity()
|
||||
|
||||
if not ent then return end -- sanity check
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user