WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   WoD Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=151)
-   -   GetRaidRosterInfo bug (https://www.wowinterface.com/forums/showthread.php?t=49875)

galvin 09-10-14 07:18 PM

GetRaidRosterInfo bug
 
Will return nil if a new person joins the raid. But only one time.
I tested this on the leveling realm, had someone join from the pve 100 realm.
once the game sees the player, even if that player logs out back in, the function won't return nil
anymore. ignore the print functions, that's just debug testing code.
I use this function when GROUP_ROSTER_UPDATE fires.

Code:

function GWL:GROUP_ROSTER_UPDATE()
  local Found = false
  local MaxMembers = GetNumGroupMembers()

  -- Preset the waitlist to Outside
  if WaitList then
    for Index, _ in pairs(WaitList) do
      WaitList[Index] = Outside
    end
  end

  -- Return if not in a group/raid.
  if MaxMembers > 0 then

    -- If first time joining a raid then start a new waitlist.
    if not RaidActive then
      ClearWaitList()
      RaidActive = true
    end

    for Index = 1, MaxMembers do

      -- Set player as in raid.
      local Player = GetRaidRosterInfo(Index)
      print('>', Player, Player == nil)
      if Player and Player ~= '' then
        Player = Ambiguate(GetRaidRosterInfo(Index), 'none')
        if Player then
          print(':', Player)
          WaitList[Player] = InRaid
        end
      end
    end
  else
    RaidActive = false
  end

  -- Save RaidActive status
  GalvinWaitListDB.RaidActive = RaidActive

  return Found
end


Phanx 09-10-14 09:59 PM

Not related to the bug, but:

Code:

      local Player = GetRaidRosterInfo(Index)
      print('>', Player, Player == nil)
      if Player and Player ~= '' then
        Player = Ambiguate(GetRaidRosterInfo(Index), 'none')

Why call GetRaidRosterInfo(Index) a second time on the last line, when you already called it and stored its value in the Player variable on the first line? Just do Player = Ambiguate(Player, 'none') there.

galvin 09-11-14 12:40 AM

Oops, bug still remains though.

semlar 09-11-14 02:19 AM

It sounds like the game isn't caching the player's info until you actually request it.

You may want to delay your GetRaidRosterInfo call to see if it always fails the first time you call it or only when you call it immediately after they join.


All times are GMT -6. The time now is 06:01 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI