From e783ab17dc78f32d56f3c94b96805f18a6f2a715 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 9 May 2018 16:49:37 +0200 Subject: [PATCH] Force stuck arrows to be rechecked after punch --- mods/ITEMS/mcl_bows/arrow.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index c7528f7cf2..5bbb0bf962 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -81,6 +81,7 @@ local ARROW_ENTITY={ _shooter=nil, -- ObjectRef of player or mob who shot it } +-- Destroy arrow entity self at pos and drops it as an item local spawn_item = function(self, pos) if not minetest.settings:get_bool("creative_mode") then local item = minetest.add_item(pos, "mcl_bows:arrow") @@ -275,6 +276,14 @@ ARROW_ENTITY.on_step = function(self, dtime) self._lastpos={x=pos.x, y=pos.y, z=pos.z} end +-- Force recheck of stuck arrows when punched. +-- Otherwise, punching has no effect. +ARROW_ENTITY.on_punch = function(self) + if self._stuck then + self._stuckrechecktimer = STUCK_RECHECK_TIME + end +end + ARROW_ENTITY.get_staticdata = function(self) local out = { lastpos = self._lastpos,