mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2024-09-27 14:50:30 +02:00
give a more informative error when trying to register stairs for an unregistered node
This commit is contained in:
parent
192554a527
commit
d844a5f8b7
|
@ -5,6 +5,8 @@ if not stairsplus.has.stairs then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local f = string.format
|
||||||
|
|
||||||
local api = stairsplus.api
|
local api = stairsplus.api
|
||||||
|
|
||||||
local S = stairsplus.S
|
local S = stairsplus.S
|
||||||
|
@ -19,6 +21,9 @@ function stairs.register_stair(subname, node, groups, tiles, description, sounds
|
||||||
local meta = {
|
local meta = {
|
||||||
align_style = worldaligntex and "world" or default_align_style
|
align_style = worldaligntex and "world" or default_align_style
|
||||||
}
|
}
|
||||||
|
if not minetest.registered_nodes[node] then
|
||||||
|
error(f("cannot register stairs for unknown node %q", node))
|
||||||
|
end
|
||||||
if is_legacy_drawtype(node) then
|
if is_legacy_drawtype(node) then
|
||||||
meta.ignore_drawtype = true
|
meta.ignore_drawtype = true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user