-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RegisterBGEvent - bg:GetMap(), (nil) missing metatable #426
Comments
What core are you using? (TC, AC, mangos, cmangos, ...) |
Tried with both Azerothcore and Trinitycore from various versions, same result. But let's say Azerothcore. |
The issue seems to be that GetMap in C++ returns a BattlegroundMap which is not supported/implemented. |
Unfortunately doesn't work. Code: function start(event, bg, bgId, instanceId)
-- get players in the battleground
local map = bg:GetMap()
-- if map is nil
if map == nil then
PrintInfo("GetMap returned nil")
return
end
local players = map:GetPlayers()
if players == nil then
PrintInfo("players returned nil")
return
end
-- loop through all players in the battleground
for _, player in pairs(players) do
-- get the player's team
local team = player:GetTeam()
PrintInfo("Got Player")
end
PrintInfo("end of start()")
end
RegisterBGEvent(1, start) |
Are you still having the issue?
I think that originally the error message was saying null, so the error probably did not change. |
As title mentions, upon the callback of RegisterBGEvent, if you try to get the bg's map you will get (nil) missing metatable.
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: