Hey ive been having some irregularities with one of my teleport functions. Particularly with my blacklist.
I have "Tel Galen" in my blacklist and have trouble teleporting to "Galen". I guess what I'm needing is a way to exactly match not match part of "Tel Galen".
Heres a sort of example of what I'm using to achieve what I have now.
Code:
local _, _, memberZone, _, _, _, _, memberzoneID = GetGuildMemberCharacterInfo(guildId, memberIndex)
if not MyAddon.ZoneBlacklist(memberZone) then
teleport to blah blah blah
end
function MyAddon.ZoneBlacklist(value)
local zones = {
"Tel Galen",
}
for _, zoneName in ipairs(zones) do
if string.match(zoneName, value) then return true end
end
return false
end
Whats happening is when someone is in "Galen" and it does the blacklist check its returning true for "Tel Galen" and not performing the teleport. I need some way to ensure "Galen" zone returns false like an exact match start to finish not partial. Any suggestions? Im wondering if just reversing zoneName, value in the string.match to value, zoneName might do the job and look for "Tel Galen" in "Galen".