From 57c787f2719cfd71a247600ed18ba0daa1962331 Mon Sep 17 00:00:00 2001 From: LaYt Date: Sat, 8 Jul 2023 17:32:26 +0700 Subject: [PATCH] Check for empty names in GuildRoaster Some times HC chars leave empty names in guild roaster (TWOW) --- shootyepgp.lua | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/shootyepgp.lua b/shootyepgp.lua index 0bcb746..22188cf 100644 --- a/shootyepgp.lua +++ b/shootyepgp.lua @@ -1511,28 +1511,30 @@ function sepgp:buildRosterTable() sepgp.alts = {} for i = 1, numGuildMembers do local member_name,_,_,level,class,_,note,officernote,_,_ = GetGuildRosterInfo(i) - local main, main_class, main_rank = self:parseAlt(member_name,officernote) - local is_raid_level = tonumber(level) and level >= sepgp.VARS.minlevel - if (main) then - if ((self._playerName) and (name == self._playerName)) then - if (not sepgp_main) or (sepgp_main and sepgp_main ~= main) then - sepgp_main = main - self:defaultPrint(L["Your main has been set to %s"],sepgp_main) + if member_name and member_name ~= "" then + local main, main_class, main_rank = self:parseAlt(member_name,officernote) + local is_raid_level = tonumber(level) and level >= sepgp.VARS.minlevel + if (main) then + if ((self._playerName) and (name == self._playerName)) then + if (not sepgp_main) or (sepgp_main and sepgp_main ~= main) then + sepgp_main = main + self:defaultPrint(L["Your main has been set to %s"],sepgp_main) + end + end + main = C:Colorize(BC:GetHexColor(main_class), main) + sepgp.alts[main] = sepgp.alts[main] or {} + sepgp.alts[main][member_name] = class + end + if (sepgp_raidonly) and next(r) then + if r[member_name] and is_raid_level then + table.insert(g,{["name"]=member_name,["class"]=class}) + end + else + if is_raid_level then + table.insert(g,{["name"]=member_name,["class"]=class}) end end - main = C:Colorize(BC:GetHexColor(main_class), main) - sepgp.alts[main] = sepgp.alts[main] or {} - sepgp.alts[main][member_name] = class end - if (sepgp_raidonly) and next(r) then - if r[member_name] and is_raid_level then - table.insert(g,{["name"]=member_name,["class"]=class}) - end - else - if is_raid_level then - table.insert(g,{["name"]=member_name,["class"]=class}) - end - end end return g end