Another crash bugfix, for the same reason as in the previous commit

This commit is contained in:
upsilon 2017-01-07 18:48:59 +01:00
parent 6d84b5d63a
commit 15e57c0397

View File

@ -35,16 +35,16 @@ local function arrow_step(self, dtime)
end
local hit = function(pos, node, obj)
self.object:remove()
if obj then
if obj:is_player() then
if self.timer > 0.2 and obj:get_playername() == self.player then -- Avoid hitting the hitter
if self.timer > 0.2 and obj:get_player_name() == self.player then -- Avoid hitting the hitter
return
end
end
end
self.object:remove()
if node and minetest.is_protected(pos, self.player) then -- Forbid hitting nodes in protected areas
return
end