From 15e57c03970cc292ac402d5799c139bf685b4ede Mon Sep 17 00:00:00 2001 From: upsilon Date: Sat, 7 Jan 2017 18:48:59 +0100 Subject: [PATCH] Another crash bugfix, for the same reason as in the previous commit --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 11e8de3..5bd5f55 100644 --- a/init.lua +++ b/init.lua @@ -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