Skip to content

Commit

Permalink
Check for only the name part without realm
Browse files Browse the repository at this point in the history
  • Loading branch information
Ketho committed Feb 2, 2021
1 parent 4e427c4 commit d943e16
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Peggle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -723,11 +723,14 @@ end
function o.TableFind(n, o)
local t, e;
for e = 1, #n do
-- hack: some names have their realm name appended and some don't
-- some names have their realm name appended and some don't
-- so peggle would not find a specific names in Battle mode
-- if(n[e] == o)then
if strfind(n[e], "-") then
if strfind(n[e], o) then
-- I don't know what else this function is used for, so check for a hyphen
-- this hack can be buggy for players with the same name but different realm
-- or players with a partial name match
if strfind(n[e], "-") or strfind(o, "-") then
local name = strmatch(o, "(.+)%-") or o
if strfind(n[e], name) then
t = e;
break;
end
Expand Down

0 comments on commit d943e16

Please sign in to comment.