Merge pull request 'Add secondary existence check after main logic has been executed to prevent future crashes' (#1657) from jordan4ibanez/MineClone2:mineclone5 into mineclone5
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/1657mineclone5
commit
c40011b566
|
@ -1101,6 +1101,12 @@ mobs.mob_step = function(self, dtime)
|
|||
end
|
||||
end
|
||||
|
||||
--do not continue if non-existent
|
||||
if not self or not self.object or not self.object:get_luaentity() then
|
||||
self.object:remove()
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
-- can mob be pushed, if so calculate direction -- do this last (overrides everything)
|
||||
if self.pushable then
|
||||
|
|
|
@ -378,3 +378,4 @@ mobs_mc.spawn_height.overworld_max)
|
|||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:sheep", S("Sheep"), "mobs_mc_spawn_icon_sheep.png", 0)
|
||||
|
||||
|
|
Loading…
Reference in New Issue