aboutsummaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorDS <vorunbekannt75@web.de>2020-11-10 21:03:10 +0100
committerGitHub <noreply@github.com>2020-11-10 21:03:10 +0100
commitbe3fe161fc831c9e6da1357dc908ed4a7681c46c (patch)
treefd8d978e624f814ded82971cb902d7dd7ed5fc75 /builtin/game
parentfca4db4184ac054c53446c0960ec578ebc6b5857 (diff)
downloadminetest-be3fe161fc831c9e6da1357dc908ed4a7681c46c.tar.gz
minetest-be3fe161fc831c9e6da1357dc908ed4a7681c46c.tar.bz2
minetest-be3fe161fc831c9e6da1357dc908ed4a7681c46c.zip
Do not set a default for description in itemdef table (#10559)
* Do not set a default for description in itemdef table * improve documentation
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/register.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin/game/register.lua b/builtin/game/register.lua
index f00b76494..1f94a9dca 100644
--- a/builtin/game/register.lua
+++ b/builtin/game/register.lua
@@ -118,11 +118,9 @@ 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.*","")
+ (itemdef.description or ""):gsub("\n.*","")
-- Apply defaults and add to registered_* table
if itemdef.type == "node" then