fix for charges

This commit is contained in:
Manuel Simon Hirsig
2016-02-29 18:54:09 +01:00
parent 5afba477a4
commit 5ad5784be7
+5
View File
@@ -294,6 +294,11 @@ end
function private.item_charges(tooltip)
for _, line in ipairs(tooltip) do
-- recipes also contain the charges tooltip for the item they teach so we have to ignore them
local ignore_pattern = '^Use: Teaches you how to create'
if strfind(line.left_text or '', ignore_pattern) or strfind(line.right_text or '', ignore_pattern) then
return
end
local pattern = '^(%d+) Charges$'
local _, _, left_charges_string = strfind(line.left_text or '', pattern)
local _, _, right_charges_string = strfind(line.right_text or '', pattern)