From d844a5f8b74de5586dbefb98f5b2be54e36231ea Mon Sep 17 00:00:00 2001 From: flux <25628292+fluxionary@users.noreply.github.com> Date: Fri, 9 Dec 2022 10:58:29 -0800 Subject: [PATCH] give a more informative error when trying to register stairs for an unregistered node --- stairsplus/compat/stairs.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stairsplus/compat/stairs.lua b/stairsplus/compat/stairs.lua index 1fb6f6c..69e940b 100644 --- a/stairsplus/compat/stairs.lua +++ b/stairsplus/compat/stairs.lua @@ -5,6 +5,8 @@ if not stairsplus.has.stairs then return end +local f = string.format + local api = stairsplus.api local S = stairsplus.S @@ -19,6 +21,9 @@ function stairs.register_stair(subname, node, groups, tiles, description, sounds local meta = { 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 meta.ignore_drawtype = true end