add utility alias for level-0 leveled nodes.

leveled nodes now have an alias from level 0 to air, meaning that code
that changes the level of a node doesn't have to differentiate between
setting its level, and removing the node when the level is supposed to
be 0.
This commit is contained in:
trans_soup 2023-10-22 21:55:01 +02:00
parent 4436b9068a
commit 2de047d37a

View file

@ -79,4 +79,5 @@ function blockgame.register_leveled_node (name, def)
end end
minetest.register_alias(fullname, fullname .. "_" .. def.level_max) minetest.register_alias(fullname, fullname .. "_" .. def.level_max)
minetest.register_alias(fullname .. "_" .. 0, "air")
end end