Two related errors that are confusing me
1 Attachment(s)
Attached is the retail zip of RepByZone in progress. As it stands, I'm getting the following error:
Lua Code:
Lua Code:
Lua Code:
Please send help! I've run out of ideas. |
Somewhere, adding the extra lines has created a recursive call that gets back to RepByZone:SwitchedZones()
Simple check, change: Code:
function RepByZone:SwitchedZones() Code:
local count = 0 |
Quote:
This is triggered both from RepByZone:OnEnable() calling RepByZone:ZoneAndFactionList() and your events calling RepByZone:SwitchedZones(). Quote:
Quote:
Code:
zonesAndFactions = self:ZoneAndFactionList() This continues on to RepByZone:CheckSholazarBasin(), which proceeds with calling RepByZone:SwitchedZones(). Note this function hasn't returned yet either and continues holding up the line. Now RepByZone:SwitchedZones() is running, but because neither of the functions have had the ability to return yet, subZonesAndFactions (to be set after zonesAndFactions in RepByZone:OnEnable()) is still nil. I suggest removing self:SwitchedZones() from RepByZone:CheckSholazarBasin(). That one line is what's causing all of your problems. If you need to call RepByZone:SwitchedZones() from RepByZone:OnEnable(), put it in there. |
1 Attachment(s)
Whew. Thank you SDPhantom. That was driving me crazy. Do I need to/should I be calling self:SwitchedZones() in Options.lua? I can't tell if that is causing a stack overflow that isn't being caught, as commenting out the lines or leaving them in doesn't seem to make BugSack unhappy.
Also, now that I no longer have any errors, something else is confusing me. After your explanation, I fixed the code in self:CheckSolazarBasin(). So far so good.... until I zoned into my garrison. Once there, I still don't get any errors (woot~ :banana: ) but now my bodyguard's faction isn't being set as the watched faction. My Night Elf Demon Hunter is watching Darnassus in both the garrison and the mine/excavation. Heading out to Shadowmoon Valley watches Council of Exarchs, which would be correct if I wasn't supposed to be watching Delvar Ironfist. So, the code is ignoring the bodyguards. Hm, okay. But why? Attached is the updated zip. |
Quote:
Quote:
Code:
local isWoDZone = #self.WoDFollowerZones > 0 and self.WoDFollowerZones[UImapID] or self.WoDFollowerZones[parentMapID] Code:
RepByZone.WoDFollowerZones = { Another unrelated issue is you should reinitialize your data tables when a Pandaren chooses their faction. Otherwise, the faction-specific reps won't load correctly. The following additions should correct this. Code:
function RepByZone:CheckPandaren(event, success) |
1 Attachment(s)
Attached is the latest zip with all the file changes.
I have the feeling that CheckBodyguard() is returning nil because "Lua doesn't work that way", a mistake I seem to make a lot, given this thread. For brevity, here's the function by itself. The commented URL is a list of IsQuestCompleted() if the player talks to the bodyguard and says "come with me, I need muscle". I'm not sure if I need to check for quest completion, or if simply assigning the follower to the barracks is enough. If the follower is not actually hanging out with the player, the follower does not gain reputation, so I might have to check. Lua Code:
|
The first thing that caught my attention.
Code:
local bodyguardRep = self:CheckBodyguard() |
All times are GMT -6. The time now is 02:58 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI