forked from VoxeLibre/VoxeLibre
Fix mesecons crash caused by arrow
This commit is contained in:
parent
c43b8baff4
commit
19dd11dfb8
|
@ -66,7 +66,9 @@ local ARROW_ENTITY={
|
||||||
|
|
||||||
ARROW_ENTITY.on_step = function(self, dtime)
|
ARROW_ENTITY.on_step = function(self, dtime)
|
||||||
local pos = self.object:getpos()
|
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
|
if self._stuck then
|
||||||
self._stucktimer = self._stucktimer + dtime
|
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})
|
self.object:set_acceleration({x=0, y=0, z=0})
|
||||||
-- Push the button
|
-- 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
|
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
|
end
|
||||||
elseif (def and def.liquidtype ~= "none") then
|
elseif (def and def.liquidtype ~= "none") then
|
||||||
-- Slow down arrow in liquids
|
-- Slow down arrow in liquids
|
||||||
|
|
Loading…
Reference in New Issue