diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 698c0135fc..98f4e493f1 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -993,11 +993,6 @@ void Battleground::StartBattleground() // and it doesn't matter if we call StartBattleground() more times, because m_Battlegrounds is a map and instance id never changes sBattlegroundMgr->AddBattleground(this); -#ifdef ELUNA - if (Eluna* e = GetBgMap()->GetEluna()) - e->OnBGCreate(this, GetTypeID(), GetInstanceID()); -#endif - if (m_IsRated) TC_LOG_DEBUG("bg.arena", "Arena match type: {} for Team1Id: {} - Team2Id: {} started.", m_ArenaType, m_ArenaTeamIds[TEAM_ALLIANCE], m_ArenaTeamIds[TEAM_HORDE]); } diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 141f1808eb..faa764ed50 100644 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -29,6 +29,10 @@ #include "VMapManager2.h" #include "World.h" +#ifdef ELUNA +#include "LuaEngine.h" +#endif + MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL) { // fill with zero @@ -263,6 +267,12 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun bg->SetBgMap(map); m_InstancedMaps[InstanceId] = map; + +#ifdef ELUNA + if (Eluna* e = map->GetEluna()) + e->OnBGCreate(bg, bg->GetTypeID(), InstanceId); +#endif + return map; }