mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-17 08:31:08 +01:00
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/1657
This commit is contained in:
commit
c40011b566
2 changed files with 7 additions and 0 deletions
|
@ -1101,6 +1101,12 @@ mobs.mob_step = function(self, dtime)
|
||||||
end
|
end
|
||||||
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)
|
-- can mob be pushed, if so calculate direction -- do this last (overrides everything)
|
||||||
if self.pushable then
|
if self.pushable then
|
||||||
|
|
|
@ -378,3 +378,4 @@ mobs_mc.spawn_height.overworld_max)
|
||||||
|
|
||||||
-- spawn eggs
|
-- spawn eggs
|
||||||
mobs:register_egg("mobs_mc:sheep", S("Sheep"), "mobs_mc_spawn_icon_sheep.png", 0)
|
mobs:register_egg("mobs_mc:sheep", S("Sheep"), "mobs_mc_spawn_icon_sheep.png", 0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue