mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-17 16:41:06 +01:00
Don't touch description if tt snippets did nothing (#4264)
This should prevent problems like the ones described in https://git.minetest.land/MineClone2/MineClone2/pulls/4196#issuecomment-77558 or https://git.minetest.land/MineClone2/MineClone2/pulls/4130#issuecomment-77571 Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/4264 Co-authored-by: the-real-herowl <wiktor_t-i@proton.me> Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
This commit is contained in:
parent
4e12c6747c
commit
5f70189e08
1 changed files with 1 additions and 0 deletions
|
@ -76,6 +76,7 @@ function tt.reload_itemstack_description(itemstack)
|
||||||
orig_desc = minetest.colorize(tt.NAME_COLOR, meta:get_string("name"))
|
orig_desc = minetest.colorize(tt.NAME_COLOR, meta:get_string("name"))
|
||||||
end
|
end
|
||||||
local desc = apply_snippets(orig_desc, itemstring, toolcaps or def.tool_capabilities, itemstack)
|
local desc = apply_snippets(orig_desc, itemstring, toolcaps or def.tool_capabilities, itemstack)
|
||||||
|
if desc == def.description and meta:get_string("description") == "" then return end
|
||||||
meta:set_string("description", desc)
|
meta:set_string("description", desc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue