From 5564610b099845b3b0776b7ce98ef0e249c7e69b Mon Sep 17 00:00:00 2001 From: teknomunk Date: Mon, 9 Sep 2024 10:08:44 -0500 Subject: [PATCH] Small optimization for calculating _allow_punch --- mods/ITEMS/mcl_bows/arrow.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index eb46dd089..10c88a4ff 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -297,9 +297,7 @@ local arrow_entity = { end local pos = self.object:get_pos() - if not self._startpos or pos and vector.distance(self._startpos, pos) > 1.5 then - self._allow_punch = true - end + self._allow_punch = self._allow_punch or not self._startpos or pos and vector.distance(self._startpos, pos) > 1.5 if self._stuck then return stuck_arrow_on_step(self, dtime)