Party Rank Icons not always there.
OK my latest mod PVP Rank Icons is having a problem I can't seem to cure.
What does not work is the PVP Rank Icon showing on the party members reliably. The basic principle that I'm working against is the fact that when one joins a party they may more may not be in range for thier honor information to be displayed. The range is limited. So when the player does come in range the script I have does not rerun to get thier rank again. It simply assumes that they had a rank that was less than or equal to zero like they did when they were out of range. I assumed that simply running the script onupdate would force the script to run and recheck every party member regularly. This does not appear to work. If someone new joins the party. All members that were there prior have thier status updated properly. The same thing happens when the player spawns after death in the grave yard. Out of range all ranks are set to zero and do not change until the party changes or the player enters world. I am including the entire script and hoping one of you can shed some light on this issue for me. Code:
MAX_PARTY_MEMBERS = 4 |
There's a function UnitIsVisible() that returns true when the unit is nearby and information about them is visible. You could use that to determine if a player's pvp status is legitimate.
For updating when they do get in range/join group, does their PVP rank become available when their portrait changes? I'm not sure if that range is the same as the UnitIsVisible() range, but you could try registering for UNIT_PORTRAIT_UPDATE and if arg1 is party1-4 then grab their pvp information. To minimize the amount of times the game runs through the checks you could see if UNIT_PORTRAIT_UPDATE fires after PARTY_MEMBERS_CHANGED (I suspect so). If so then: PARTY_MEMBERS_CHANGED: Register for UNIT_PORTRAIT_UPDATE UNIT_PORTRAIT_UPDATE: for i=1,4 do if UnitIsVisible("party"..i) then update PvP rank for "party"..i end Unregister UNIT_PORTRAIT_UPDATE |
All times are GMT -6. The time now is 12:46 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI