Remove unnecessary branch
This commit is contained in:
parent
a8dfbc003e
commit
f0f9c5f2d4
@ -267,12 +267,7 @@ core.register_on_mapblocks_changed(function(modified_blocks, modified_blocks_cou
|
|||||||
--Update only changed nodes from buffer
|
--Update only changed nodes from buffer
|
||||||
for _, lpn in pairs(b) do
|
for _, lpn in pairs(b) do
|
||||||
if lpn.init_liquid_level ~= lpn.liquid_level then
|
if lpn.init_liquid_level ~= lpn.liquid_level then
|
||||||
--TODO: Find out whether set_node or set_node_level is faster
|
|
||||||
if lpn.liquid_level >= 0 or lpn.liquid_level >= 8 then
|
|
||||||
core.set_node(lpn.pos, { name = liquid_physics.get_liquid_node_name(lpn.liquid_id, lpn.liquid_level) })
|
core.set_node(lpn.pos, { name = liquid_physics.get_liquid_node_name(lpn.liquid_id, lpn.liquid_level) })
|
||||||
elseif lpn.liquid_level < 8 then
|
|
||||||
core.set_node_level(lpn.pos, lpn.liquid_level)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user