Add files via upload

This commit is contained in:
loosewheel
2022-02-19 14:08:26 +10:00
committed by GitHub
parent f41ab00398
commit eaf6a679c3
8 changed files with 352 additions and 74 deletions

View File

@@ -120,6 +120,9 @@ local function push_nodes (pos, extent)
end
local tmeta = cmeta:to_table ()
local ctimer = minetest.get_node_timer (cpos)
local ctimeout = (ctimer and ctimer:get_timeout ()) or 0
local celapsed = (ctimer and ctimer:get_elapsed ()) or 0
push_entities (cpos, vec)
@@ -136,6 +139,14 @@ local function push_nodes (pos, extent)
cmeta:from_table (tmeta)
end
if ctimeout > 0 then
ctimer = minetest.get_node_timer (last)
if ctimer then
ctimer:set (ctimeout, celapsed)
end
end
last = cpos
end
end
@@ -161,6 +172,9 @@ local function pull_node (pos, extent)
if cmeta then
local tpos = vector.subtract (cpos, vec)
local tmeta = cmeta:to_table ()
local ctimer = minetest.get_node_timer (cpos)
local ctimeout = (ctimer and ctimer:get_timeout ()) or 0
local celapsed = (ctimer and ctimer:get_elapsed ()) or 0
minetest.remove_node (cpos)
minetest.set_node (tpos, cnode)
@@ -172,6 +186,14 @@ local function pull_node (pos, extent)
cmeta:from_table (tmeta)
end
end
if ctimeout > 0 then
ctimer = minetest.get_node_timer (tpos)
if ctimer then
ctimer:set (ctimeout, celapsed)
end
end
end
end
end