View Single Post
07/04/17, 11:38 AM   #8
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
Of course GetGuildId() will always return 1 when you use it like that. It requires the guild index as a parameter:
Lua Code:
  1. for i = 1, GetNumGuilds() do
  2. local guildId = GetGuildId(i)
  3. end

And I don't know why you use GUILD_SHARED_INFO.guildId when I showed you a working piece of code?
In my example I use self.guildId, where self is GUILD_ROSTER_MANAGER. GUILD_ROSTER_MANAGER.guildId is updated before OnGuildIdChanged is called, so in the prehook you already get the new id that way.

Lua Code:
  1. function ZO_GuildRosterManager:SetGuildId(guildId)
  2.     self.guildId = guildId
  3.     self.guildName = GetGuildName(guildId)
  4.     self.guildAlliance = GetGuildAlliance(guildId)
  5.  
  6.     self:OnGuildIdChanged()
  7.     self:RefreshAll()
  8. end
  Reply With Quote