View Single Post
05-24-20, 04:42 PM   #4
sylvanaar
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 92
There is a huge bug IMO in the blizzard code.


ClubFinder.lua:559

Lua Code:
  1. UIDropDownMenu_AddButton(info, level);

In this code "level" is a GLOBAL!

This means that it could be interacting with other code that sets the global "level" variable!

So if you are lucky that level variable will be nil, and when you call into AddButton, it will get set to 1 by this code

Lua Code:
  1. if ( not level ) then
  2.         level = 1;
  3.     end


So, that is all well and good - but it is breaking for you. So let check out your code to see if you might be using the same variable.

https://sourcegraph.com/github.com/k...yer.lua#L121:5

You also appear to be writing to the global "level" variable

Lua Code:
  1. level = UnitLevel('player');

You should try to avoid writing to global variables if at all possible. Cheers!
  Reply With Quote