aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2021-02-17 18:53:44 +0000
committerGitHub <noreply@github.com>2021-02-17 18:53:44 +0000
commita8f6befd398cb8f962f3bb1fab092d6355bfe015 (patch)
tree57c8410f8491b94692963f68cf43be3d100d7c90 /src/script
parent7832b6843e73410e15677d1324d582b4b7c7e824 (diff)
downloadminetest-a8f6befd398cb8f962f3bb1fab092d6355bfe015.tar.gz
minetest-a8f6befd398cb8f962f3bb1fab092d6355bfe015.tar.bz2
minetest-a8f6befd398cb8f962f3bb1fab092d6355bfe015.zip
Fix short_description fallback order (#10943)
Diffstat (limited to 'src/script')
-rw-r--r--src/script/common/c_content.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index ecab7baa1..2f9fbd74b 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -140,8 +140,10 @@ void push_item_definition_full(lua_State *L, const ItemDefinition &i)
lua_setfield(L, -2, "name");
lua_pushstring(L, i.description.c_str());
lua_setfield(L, -2, "description");
- lua_pushstring(L, i.short_description.c_str());
- lua_setfield(L, -2, "short_description");
+ if (!i.short_description.empty()) {
+ lua_pushstring(L, i.short_description.c_str());
+ lua_setfield(L, -2, "short_description");
+ }
lua_pushstring(L, type.c_str());
lua_setfield(L, -2, "type");
lua_pushstring(L, i.inventory_image.c_str());