forked from Mirrorlandia_minetest/mesecons
Fix a rare piston pushing bug and make piston updating faster.
This commit is contained in:
parent
618fd31f43
commit
aaddd9e74d
@ -134,7 +134,7 @@ local update = function(pos, node)
|
|||||||
|
|
||||||
local timer = minetest.env:get_node_timer(pos)
|
local timer = minetest.env:get_node_timer(pos)
|
||||||
timer:stop()
|
timer:stop()
|
||||||
timer:set(0.1, 0)
|
timer:start(0)
|
||||||
end
|
end
|
||||||
mesecon:register_on_signal_on(update) --push action
|
mesecon:register_on_signal_on(update) --push action
|
||||||
mesecon:register_on_signal_off(update) --pull action
|
mesecon:register_on_signal_off(update) --pull action
|
||||||
@ -150,14 +150,13 @@ function mesecon:piston_push(pos)
|
|||||||
while true do
|
while true do
|
||||||
local checknode = minetest.env:get_node(checkpos)
|
local checknode = minetest.env:get_node(checkpos)
|
||||||
|
|
||||||
--check for collision with stopper
|
--check for collision with stopper or bounds
|
||||||
if mesecon:is_mvps_stopper(checknode.name) then
|
if mesecon:is_mvps_stopper(checknode.name) or checknode.name == "ignore" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
--check for column end
|
--check for column end
|
||||||
if checknode.name == "air"
|
if checknode.name == "air"
|
||||||
or checknode.name == "ignore"
|
|
||||||
or not(minetest.registered_nodes[checknode.name].liquidtype == "none") then
|
or not(minetest.registered_nodes[checknode.name].liquidtype == "none") then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
@ -133,14 +133,13 @@ mesecon:register_on_signal_on(function(pos, node)
|
|||||||
while true do
|
while true do
|
||||||
local checknode = minetest.env:get_node(checkpos)
|
local checknode = minetest.env:get_node(checkpos)
|
||||||
|
|
||||||
--check for collision with stopper
|
--check for collision with stopper or bounds
|
||||||
if mesecon:is_mvps_stopper(checknode.name) then
|
if mesecon:is_mvps_stopper(checknode.name) or checknode.name == "ignore" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
--check for column end
|
--check for column end
|
||||||
if checknode.name == "air"
|
if checknode.name == "air"
|
||||||
or checknode.name == "ignore"
|
|
||||||
or not(minetest.registered_nodes[checknode.name].liquidtype == "none") then
|
or not(minetest.registered_nodes[checknode.name].liquidtype == "none") then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
@ -121,14 +121,13 @@ mesecon:register_on_signal_on(function(pos, node)
|
|||||||
while true do
|
while true do
|
||||||
local checknode = minetest.env:get_node(checkpos)
|
local checknode = minetest.env:get_node(checkpos)
|
||||||
|
|
||||||
--check for collision with stopper
|
--check for collision with stopper or bounds
|
||||||
if mesecon:is_mvps_stopper(checknode.name) then
|
if mesecon:is_mvps_stopper(checknode.name) or checknode.name == "ignore" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
--check for column end
|
--check for column end
|
||||||
if checknode.name == "air"
|
if checknode.name == "air"
|
||||||
or checknode.name == "ignore"
|
|
||||||
or not(minetest.registered_nodes[checknode.name].liquidtype == "none") then
|
or not(minetest.registered_nodes[checknode.name].liquidtype == "none") then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user