142
142
-- Some common functions
143
143
--
144
144
145
- function nodeupdate_single (p )
145
+ function nodeupdate_single (p , delay )
146
146
n = minetest .env :get_node (p )
147
147
if minetest .get_node_group (n .name , " falling_node" ) ~= 0 then
148
148
p_bottom = {x = p .x , y = p .y - 1 , z = p .z }
@@ -151,9 +151,13 @@ function nodeupdate_single(p)
151
151
if minetest .registered_nodes [n_bottom .name ] and
152
152
(not minetest .registered_nodes [n_bottom .name ].walkable or
153
153
minetest .registered_nodes [n_bottom .name ].buildable_to ) then
154
- minetest .env :remove_node (p )
155
- spawn_falling_node (p , n .name )
156
- nodeupdate (p )
154
+ if delay then
155
+ minetest .after (0.1 , nodeupdate_single , {x = p .x , y = p .y , z = p .z }, false )
156
+ else
157
+ minetest .env :remove_node (p )
158
+ spawn_falling_node (p , n .name )
159
+ nodeupdate (p )
160
+ end
157
161
end
158
162
end
159
163
@@ -170,14 +174,11 @@ function nodeupdate(p)
170
174
p .x = math.floor (p .x + 0.5 )
171
175
p .y = math.floor (p .y + 0.5 )
172
176
p .z = math.floor (p .z + 0.5 )
173
- nodeupdate_single (p )
174
177
175
178
for x = - 1 ,1 do
176
179
for y = - 1 ,1 do
177
180
for z = - 1 ,1 do
178
- if not (x == 0 and y == 0 and z == 0 ) then
179
- minetest .after (0.1 , nodeupdate_single , {x = p .x + x , y = p .y + y , z = p .z + z })
180
- end
181
+ nodeupdate_single ({x = p .x + x , y = p .y + y , z = p .z + z }, not (x == 0 and y == 0 and z == 0 ))
181
182
end
182
183
end
183
184
end
0 commit comments