mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-27 12:12:59 +00:00
Fix crash when skeleton kills player using bow
Commit 5252952555
used string.gsub() to
strip newlines from tools in death messages. The second return value of
string.gsub() (the number of substitutions) was erroneously returned too
by get_tool_name(). This bug caused a crash whenever a skeleton killed a
player using its bow.
This commit is contained in:
parent
d70c05e92c
commit
f9e3c4fd6d
1 changed files with 2 additions and 1 deletions
|
@ -7,7 +7,8 @@ local function get_tool_name(item)
|
|||
local def = item:get_definition()
|
||||
name=def._tt_original_description or def.description
|
||||
end
|
||||
return name:gsub("[\r\n]"," ")
|
||||
local sanitized_name, substitution_count = name:gsub("[\r\n]"," ")
|
||||
return sanitized_name
|
||||
end
|
||||
|
||||
mcl_death_messages = {}
|
||||
|
|
Loading…
Reference in a new issue