Add a nil check in mcl_dripping to deal with deleted blocks

This commit is contained in:
cora 2022-10-06 06:18:29 +02:00
parent 30eecae708
commit cebd37cb00

View file

@ -42,7 +42,7 @@ local function register_drop(liquid, glow, sound, nodes, interval, chance)
--with longer abm cycles --with longer abm cycles
table.shuffle(nn) table.shuffle(nn)
for i=1,math.random(#nn) do for i=1,math.random(#nn) do
if minetest.get_item_group(minetest.get_node(vector.offset(nn[i], 0, 1, 0)).name, liquid) ~= 0 if nn[i] and minetest.get_item_group(minetest.get_node(vector.offset(nn[i], 0, 1, 0)).name, liquid) ~= 0
and minetest.get_node(vector.offset(nn[i], 0, -1, 0)).name == "air" then and minetest.get_node(vector.offset(nn[i], 0, -1, 0)).name == "air" then
make_drop(nn[i],liquid,sound,interval) make_drop(nn[i],liquid,sound,interval)
end end