1 Add check for _old_pos, seem to be nil sometimes

master
Juraj Vajda 2021-05-29 12:03:46 -04:00
parent bf9a0734a1
commit 0896b123dd
1 changed files with 5 additions and 0 deletions

View File

@ -136,6 +136,11 @@ minetest.register_entity('x_bows:arrow_entity', {
end,
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))
end,