View Single Post
06/29/14, 05:12 PM   #37
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Today farangkao gave me an idea how to deal with missing account name in saved variables or maybe I should say how to deal with broken GetDisplayName() function.

Just put this code to the main chunk any of your .lua files:
Lua Code:
  1. local displayName = GetDisplayName()
  2. if displayName == nil or displayName == "" then
  3.    if GetNumGuilds() > 0 then
  4.       displayName = GetGuildMemberInfo(GetGuildId(1), GetPlayerGuildMemberIndex(GetGuildId(1)))
  5.    else
  6.       displayName = "@" .. GetCVar("AccountName")
  7.    end
  8. end
  9.  
  10. function GetDisplayName()
  11.    return displayName
  12. end

And voilą, your saved variables with @AccountName works again.

Last edited by Garkin : 06/29/14 at 05:31 PM.
  Reply With Quote