Fix crash when deleting particlespawners

This commit is contained in:
cora 2022-10-09 23:21:01 +02:00 committed by Gitea
parent 438d22e52e
commit dc873f4de2

@ -95,7 +95,7 @@ mcl_mobs:register_mob("mobs_mc:glow_squid", {
psdef.playername = p:get_player_name()
table.insert(self.particlespawners[p],minetest.add_particlespawner(psdef))
end
elseif vector.distance(pos,p:get_pos()) > 150 then
elseif vector.distance(pos,p:get_pos()) > 150 and self.particlespawners[p] then
for _,ps in pairs(self.particlespawners[p]) do
minetest.delete_particlespawner(ps)
end