1 Add check for _old_pos, seem to be nil sometimes

This commit is contained in:
Juraj Vajda 2021-05-29 12:03:46 -04:00
parent bf9a0734a1
commit 0896b123dd

View File

@ -136,6 +136,11 @@ minetest.register_entity('x_bows:arrow_entity', {
end, end,
on_death = function(self, killer) on_death = function(self, killer)
if not self._old_pos then
self.object:remove()
return
end
minetest.item_drop(ItemStack(self.arrow), nil, vector.round(self._old_pos)) minetest.item_drop(ItemStack(self.arrow), nil, vector.round(self._old_pos))
end, end,