View Single Post
07/04/17, 06:59 AM   #7
BoarGules
 
BoarGules's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2017
Posts: 34
Nailed it.

The prehook function needs to be:

Lua Code:
  1. function OnGuildIdChanged(self)
  2.     local guild_id = self.guildId
  3.     ...etc...
  4.     end

For some reason the function GetGuildId() always returns 1 in this context. And GUILD_SHARED_INFO.guildId is always one behind, because the prehook function gets called before the handler for EVENT_GUILD_DATA_LOADED in the GuildSharedInfo API class, and that handler is what changes the value in GUILD_SHARED_INFO.

Thanks for pointing me in the right direction.
  Reply With Quote