diff options
Diffstat (limited to 'builtin/game/register.lua')
-rw-r--r-- | builtin/game/register.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/game/register.lua b/builtin/game/register.lua index 3de67c04b..f00b76494 100644 --- a/builtin/game/register.lua +++ b/builtin/game/register.lua @@ -118,6 +118,12 @@ function core.register_item(name, itemdef) end itemdef.name = name + -- default description to item name + itemdef.description = itemdef.description or name + -- default short_description to first line of description + itemdef.short_description = itemdef.short_description or + itemdef.description:gsub("\n.*","") + -- Apply defaults and add to registered_* table if itemdef.type == "node" then -- Use the nodebox as selection box if it's not set manually |