Nighthawk42 / wow_bejeweled

WoW Bejeweled Addon
27 stars 10 forks source link

Bejeweled.lua:5005 - Attempt to call global 'SendAddonMessage' (a nil value) #4

Closed BalurPoco closed 5 years ago

BalurPoco commented 6 years ago

Hello,

Please be kind and fix this error:

Message: Interface\AddOns\Bejeweled\Bejeweled.lua:5005: attempt to call global 'SendAddonMessage' (a nil value)
Time: Sun Aug 19 06:40:15 2018
Count: 2
Stack: Interface\AddOns\Bejeweled\Bejeweled.lua:5005: attempt to call global 'SendAddonMessage' (a nil value)
Interface\AddOns\Bejeweled\Bejeweled.lua:5005: in function <Interface\AddOns\Bejeweled\Bejeweled.lua:4983>

Locals: t = BejeweledNetwork {
 throttleCount = 0
 guildUpdate = true
 Send = <function> defined @Interface\AddOns\Bejeweled\Bejeweled.lua:4976
 elapsed = 0
 0 = <userdata>
 queue = <table> {
 }
}
o = 0.017000000923872
e = nil
e = nil
e = nil
e = nil
i = nil
o = "HSPub+1Wolfpower*2Iq````*1Wolfpower*<W>```"
e = "GUILD"
n = ""
(*temporary) = nil
(*temporary) = "BEJ2a"
(*temporary) = "HSPub+1Wolfpower*2Iq````*1Wolfpower*<W>```"
(*temporary) = "GUILD"
(*temporary) = ""
(*temporary) = "attempt to call global 'SendAddonMessage' (a nil value)"
Bejeweled = <table> {
 timedWindow = BejeweledTimedMenu {
 }
 classicModeWindow = BejeweledClassicMenu {
 }
 debugCurrentGameData = <table> {
 }
 window = BejeweledWindow {
 }
 gameModeWindow = BejeweledGameModeMenu {
 }
 sound = BejeweledSound {
 }
 flightOptionWindow = BejeweledFlightOptionMenu {
 }
 const = <table> {
 }
 loggedIn = true
 optionsScreen = BejeweledOptionsScreen {
 }
 SecondsConvert = <function> defined @Interface\AddOns\Bejeweled\Bejeweled.lua:1943
 menuWindow = BejeweledMenu {
 }
 dataBorder = BejeweledDataBorder {
 }
 statusBar = BejeweledStatusBar {
 }
 gameStatusText = <unnamed> {
 }
 popup = BejeweledPopup {
 }
 version = "Version 8.0.1"
 pausedText = <unnamed> {
 }
 levelBarButton = BejeweledLevelBarButton {
 }
 CreateCaption = <function> defined @Interface\AddOns\Bejeweled\Bejeweled.lua:2728
 levelBar = BejeweledLevelBar {
 }
 UpdateMouseOver = <function> defined @Interface\AddOns\Bejeweled\Bejeweled.lua:2754
 levelText = <unnamed> {
 }
 dataText = <unnamed> {
 }
 repText = "You are now (.*) with (.*)."
 NumberWithCommas = <function> defined @Interface\AddOns\Bejeweled\Bejeweled.lua:1933
 levelBorder = BejeweledLevelBorder {
 }
 ScrubLists = <function> defined @Interface\AddOns\Bejeweled\Bejeweled.lua:1804
 Print = <function> defined @Interface\AddOns\Bejeweled\Bejeweled.lua:2377
 minimap = BejeweledMinimapIcon {
 }
 lootText = "You receive loot: (.*)."
 foreground = BejeweledGame {
 }
 aboutScreen = BejeweledAboutScreen {
 }
 animator = <unnamed> {
 }
 debugArray = <table> {
 }
 skillBar = BejeweledSkillBar {
 }
 featsOfSkillScreen = BejeweledFeatsOfSkillScreen {
 }
 network = BejeweledNetwork {
 }
 Dropdown_Item_OnClick = <function> defined @Interface\AddOns\Bejeweled\Bejeweled.lua:6373
 summaryScreen = BejeweledSummaryScreen {
 }
 skillLimit = true
 gameBoard = BejeweledGameBoard {
 }
 UpdateFlightTimes = <function> defined @Interface\AddOns\Bejeweled\Bejeweled.lua:1361
 TotalTime = <function> defined @Interface\AddOns\Bejeweled\Bejeweled.lua:2346
 CheckName = <function> defined @Interface\AddOns\Bejeweled\Bejeweled.lua:1699
 splashDisplayTime = 3
 levelTextCaption = <unnamed> {
 }
}
n = <table> {
 score = 0
 activeTime = 0
 round = 1
 paused = false
}
B = <function> defined =[C]:-1
xe = "BEJ2a"
BalurPoco commented 6 years ago

Change "SendAddonMessage" to "C_ChatInfo.SendAddonMessage" on line 5005 and 5008 seems like a fix.

Nighthawk42 commented 6 years ago

Yep, that seems to have fixed it. Merged.

BalurPoco commented 6 years ago

There is also an error on line 7835, e.keybindModifier is nil if I hit any modifier key while the window open. You should replace 'if (e.keybindModifier == "")' to 'if (e.keybindModifier == "" or e.keybindModifier == nil)'. What do you think?

As for me I completely commented out the OnKeyUp and OnKeyDown events (lines: 7817 - 7871), because I don't want any keyboard interaction. An option for this in the future would be nice. :) Keep up the great work.