mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-08-21 05:24:11 +02:00
parent
d325292291
commit
dcf1f799c5
@ -44,7 +44,8 @@ end
|
|||||||
-- However, even that does not work in some cases, that's why we delay the time the globalsteps
|
-- However, even that does not work in some cases, that's why we delay the time the globalsteps
|
||||||
-- start to be execute by 5 seconds
|
-- start to be execute by 5 seconds
|
||||||
local get_highest_priority = function (actions)
|
local get_highest_priority = function (actions)
|
||||||
local highestp = -1, highesti
|
local highestp = -1
|
||||||
|
local highesti
|
||||||
for i, ac in ipairs(actions) do
|
for i, ac in ipairs(actions) do
|
||||||
if ac.priority > highestp then
|
if ac.priority > highestp then
|
||||||
highestp = ac.priority
|
highestp = ac.priority
|
||||||
|
@ -477,7 +477,6 @@ minetest.register_node(nodename, {
|
|||||||
reset_meta(pos, fields.code, err)
|
reset_meta(pos, fields.code, err)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_timer = handle_timer,
|
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
mesecons = mesecons,
|
mesecons = mesecons,
|
||||||
digiline = digiline,
|
digiline = digiline,
|
||||||
|
@ -56,14 +56,15 @@ end
|
|||||||
|
|
||||||
local piston_remove_pusher = function(pos, node)
|
local piston_remove_pusher = function(pos, node)
|
||||||
pistonspec = minetest.registered_nodes[node.name].mesecons_piston
|
pistonspec = minetest.registered_nodes[node.name].mesecons_piston
|
||||||
if pushername == pistonspec.pusher then --make sure there actually is a pusher (for compatibility reasons mainly)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
dir = piston_get_direction(pistonspec.dir, node)
|
dir = piston_get_direction(pistonspec.dir, node)
|
||||||
local pusherpos = mesecon:addPosRule(pos, dir)
|
local pusherpos = mesecon:addPosRule(pos, dir)
|
||||||
local pushername = minetest.get_node(pusherpos).name
|
local pushername = minetest.get_node(pusherpos).name
|
||||||
|
|
||||||
|
-- make sure there actually is a pusher (for compatibility reasons mainly)
|
||||||
|
if pushername ~= pistonspec.pusher then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
minetest.remove_node(pusherpos)
|
minetest.remove_node(pusherpos)
|
||||||
minetest.sound_play("piston_retract", {
|
minetest.sound_play("piston_retract", {
|
||||||
pos = pos,
|
pos = pos,
|
||||||
|
Loading…
Reference in New Issue
Block a user