From 19dd11dfb897725b10bc36cf9be21a495fc42b04 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 8 May 2018 18:30:57 +0200 Subject: [PATCH] Fix mesecons crash caused by arrow --- mods/ITEMS/mcl_bows/arrow.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index 8d05affa..a7e06ae8 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -66,7 +66,9 @@ local ARROW_ENTITY={ ARROW_ENTITY.on_step = function(self, dtime) local pos = self.object:getpos() - local node = minetest.get_node(pos) + local dpos = table.copy(pos) -- digital pos + dpos = vector.round(dpos) + local node = minetest.get_node(dpos) if self._stuck then self._stucktimer = self._stucktimer + dtime @@ -178,7 +180,7 @@ ARROW_ENTITY.on_step = function(self, dtime) self.object:set_acceleration({x=0, y=0, z=0}) -- Push the button if minetest.get_modpath("mesecons_button") and minetest.get_item_group(node.name, "button") > 0 and minetest.get_item_group(node.name, "button_push_by_arrow") == 1 then - mesecon.push_button(pos, node) + mesecon.push_button(dpos, node) end elseif (def and def.liquidtype ~= "none") then -- Slow down arrow in liquids