From f2c2f4106bf10a035ca647664387a89feb62145d Mon Sep 17 00:00:00 2001 From: epCode <64379263+epCode@users.noreply.github.com> Date: Mon, 6 Jun 2022 13:55:28 -0700 Subject: [PATCH] fix arrows not disapearing after mob hit, and self damaging --- mods/ITEMS/mcl_bows/arrow.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index b15e20a7dd..d0af738a11 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -200,7 +200,7 @@ function ARROW_ENTITY.on_step(self, dtime) local arrow_dir = vector.rotate(vector.new(0,0,1), self.object:get_rotation()) local raycast = minetest.raycast(pos, vector.add(pos, vector.multiply(arrow_dir, 6)), true, false) for hitpoint in raycast do - if hitpoint.type == "object" and hitpoint.ref ~= self._shooter then + if hitpoint.type == "object" then local ok = false if hitpoint.ref:is_player() then ok = true @@ -299,6 +299,8 @@ function ARROW_ENTITY.on_step(self, dtime) minetest.after(150, function() self.object:remove() end) + else + self.object:remove() end end end