View Single Post
04/15/14, 01:55 PM   #6
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Originally Posted by Sharlikran View Post
Code:
function Harvest.IsValidBottle(name)
    for k, v in pairs(Harvest.bottle) do
		d("v name :" .. v)
		d("name :" .. string.lower(name))
        if v == string.lower(name) then
            return true
        end
    end

    return false
end
When I do that then the debug routine returns this.
Code:
:hFFFFFF:item:1187:1:13:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:hclear waterh
I fixed it by making a global variable. However, for my sanity does anyone know why that's happening?
Because the item link contains more than the name and if you turn the H into an h, it no longer is a correct item link, as a H is expected to start the color code, not a h.


And no, there is no workaround, because even if you manage to not convert the Hs, in the end your strlower will wreck havoc upon the item name once you have UTF-8 characters in it.

Last edited by Iyanga : 04/15/14 at 02:00 PM.
  Reply With Quote