BelegCufea / PrettyReputation

Simple addon to modify reputation gain messages
https://www.curseforge.com/wow/addons/pretty-reputation
GNU General Public License v3.0
4 stars 0 forks source link

Splash reputation error #15

Closed jon-ault closed 1 month ago

jon-ault commented 1 month ago

Still getting an error on splash reputation with 1.4.0c:

Lua error message ``` Message: Interface/AddOns/PrettyReputation/core.lua:500: attempt to perform arithmetic on field 'current' (a nil value) Time: Fri Aug 16 16:12:55 2024 Count: 1 Stack: Interface/AddOns/PrettyReputation/core.lua:500: attempt to perform arithmetic on field 'current' (a nil value) [string "@Interface/AddOns/PrettyReputation/core.lua"]:500: in function `processAllFactions' [string "@Interface/AddOns/PrettyReputation/core.lua"]:568: in function Locals: factionInfo = { change = 150 new = false faction = "7th Legion" } trackFaction = nil (for state) =
{ Mana Creature =
{ } Nethergarde Caravan =
{ } Dark Talons =
{ } Northsea Pirates =
{ } The Iron Horde =
{ } Grell =
{ } Elemental, Fire =
{ } Beast - Crocilisk =
{ } Old Hillpaw =
{ } The Enlightened =
{ } Undead, Scourge =
{ } Dark Kyrian =
{ } Test Faction 2 =
{ } Valarjar =
{ } Bees =
{ } Caverns of Time - Durnholde =
{ } Hand of the Prophet =
{ } Wrathgate Horde =
{ } Gilneas =
{ } Poen Gillbrack =
{ } Mount - Taxi - Neutral =
{ } CoT Scourge =
{ } Akama's Trust =
{ } Demon =
{ } Everlook =
{ } Friendly, Force Reaction 2 =
{ } Zangarmarsh Banner (Horde) =
{ } Monster, Prey =
{ } Beast - Raptor =
{ } Kirin'Var - Luminrath =
{ } Friendly, Force Reaction 4 =
{ } Protectorate =
{ } Proudmoore Admiralty =
{ } The High Hollows =
{ } Dragonmaw Clan =
{ } Moonstalker, Darkshore =
{ } Shang Xi's Academy =
{ } Friendly, Force Reaction 1 =
{ } Silithid =
{ } The Ashen Verdict =
{ } Azaloth =
{ } Revantusk Trolls =
{ } Creature =
{ } PLAYER, Orc =
{ } Titan =
{ } Kurenai =
{ } PLAYER, Lightforged Draenei =
{ } Wailing Caverns =
{ } Nagrand Gronn =
{ } Guardians of Hyjal =
{ } HIllsbrad, Southshore Mayor =
{ } The Sons of Lothar =
{ } Fish Fellreed =
{ } Maraudine =
{ } Steamwheedle Preservation Society =
{ } Impus =
{ } Primalists =
{ } Furbolg, Redfang =
{ } Arcane Annihilator (DNR) =
{ } The Black Prince =
{ } Inciter Trigger 3 =
{ } Bloodmaul Clan =
{ } Makrura =
{ } Soridormi =
{ } PLAYER, Worgen =
{ } Frostfire Ogres =
{ } Silithid Attackers =
{ } Cobalt Assembly =
{ } Test =
{ } Honor Hold =
{ } Brawl'gar Arena (Season 1) =
{ } Shadowsilk Poacher =
{ } Ratchet =
{ } Enemy =
{ } Dark Iron Dwarves =
{ } Sha'tari Defense =
{ } Classic =
{ } Murloc =
{ } Friendly, New =
{ } Craig's Squirrels =
{ } Tina Mudclaw =
{ } Cenarion Circle =
{ } The Scryers =
{ } Gnoll - Redridge =
{ } Wendigo =
{ } The Wyrmrest Accord =
{ } Cutwater Corsairs =
{ } Holiday - Generic =
{ } Elemental, Water =
{ } Tortollan Seekers =
{ } Quilboar, Deathshead =
{ } The Nightfallen =
{ } Gorgrond Goren =
{ } Nazmani =
{ } Stone Legion =
{ } The Frostborn =
{ } Monster Spar =
{ } Tushui Pandaren =
{ } Blue =
{ } Neutral, Force Reaction 1 =
{ } Tormmok =
{ } Leotheras Demon IV =
{ } Sholazar Basin =
{ } Shadow Council =
{ } Death's Advance =
{ } Shadow Council Covert =
{ } Vrykul (Ancient Siprit 2) =
{ } ```
BelegCufea commented 1 month ago

I wasn’t able to replicate the error on my end despite multiple attempts—believe me, I tried.

Additionally, I don't think the issue is related to the "Splash" reputations feature. It seems that the factions table isn't populating correctly on your side.

That said, could you please disable the "Splash" reputations option and test the addon again?

If the issue persists, would you be willing to try some temporary fixes with Debug mode enabled? I'll push them into a new branch for testing.

jon-ault commented 1 month ago

With splash reputation turned off I don't get an error.

I'd be willing to try some test builds.

jon-ault commented 1 month ago

I hopped on my main & did a world quest in each of several different expansions (Shadowlands, BfA, Legion, WoD) with splash rep turned on and couldn't duplicate the error; I put a print statement at the beginning of processAllFactions() to verify it was getting called since no splash reps were being reported. I even did a 7th Legion quest which is what I've been doing on the alt that's been getting those errors. I wonder if this has something to do with the character getting the errors being a boosted character & if that's somehow affecting the reputations that WoW reports - this level 70 toon hasn't been to Shadowlands or the Dragon Isles at all yet.

I also created a new Alliance toon & verified that splash reps were working correctly on a character that could actually get some.

BelegCufea commented 1 month ago

That's quite weird indeed. It seems to be a pretty niche issue.

Before I start guessing at potential solutions, could you please install the DevTool addon and enable the Debug option in Pretty Reputation (it’s the last option on the General tab)? After enabling debugging, make sure to /reload your UI.

Once that's done, type /dev into the chat to open the DevTool main window. You should see an entry called "Pretty Reputation_Factions". Click on it to expand the information and drill down into some of the "info" entries for different factions. It should look something like this:

image

Please post a screenshot here, as it could help me a lot in diagnosing the issue.

Thanks in advance!

jon-ault commented 1 month ago

Here's a few screenshots. One thing I noticed is that none of the main Shadowlands factions are listed (Venthyr, Necrolords, Kyrian, Night Fae) but at least some of the Dragon Isles factions are (such as Valdrakken Accord and Iskaara Tuskarr). But that also is the case for a new character. 1 - 7th legion 2 - Proudmoore 3 - vrykul

jon-ault commented 1 month ago

OK, I found something interesting. The character that's getting the errors has one more faction than my main. I tracked down the extra faction and it doesn't look right at all: Screenshot 2024-08-17 at 1 08 14 AM

I spot checked a few other characters and none of them have this "Inactive" faction listed in DevTool.

BelegCufea commented 1 month ago

I know about that pesky faction. I was certain I had dealt with it for good, but apparently not.

Could you please change line 144 of core.lua

from

    if factionData and factionData.name and factionData.factionID then

to

    if factionData and factionData.name and factionData.factionID and factionData.factionID ~= 0 then

I hope this simple change resolves the issue. If it does, I’ll go ahead and release the update.

Thank you so much for your help!

jon-ault commented 1 month ago

Looks good. I'm no longer getting the errors and the "Inactive" faction is not listed by DevTool now.

jon-ault commented 1 month ago

One other thing I noticed. When I turn in a quest on a new character that generates some splash reputation, processAllFactions() appears to be getting called once for each faction that had an increase. Here's a new Human character turning in his first quest in Northshire Valley : Screenshot 2024-08-17 at 12 10 15 PM I added that print statement at the beginning of the function. Edit: never mind, I see now those aren't splash reputation gains but are actually reported as gains by the game & show up even if splash rep is turned off.

BelegCufea commented 1 month ago

OK, thanks for testing.

And about that multiple callings ... that is why "Splash" option is soo CPU heavy. BTW it only works on two faction groups in WotLK, {Alliance Vanguard/Horde Expedition}. It is not really usefull since then. Maybe I should hide it or something, IDK :-(

jon-ault commented 1 month ago

I didn't realize how rare those splash reputation occurrences really were, I thought they happened a lot more frequently than that.