mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Maps: Initialize instance faction using group leader (if available) instead of the first player entering the map
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "MapManager.h"
|
||||
#include "BattlefieldMgr.h"
|
||||
#include "Battleground.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Containers.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DB2Stores.h"
|
||||
@@ -223,7 +224,7 @@ Map* MapManager::CreateMap(uint32 mapId, Player* player)
|
||||
|
||||
if (!map)
|
||||
{
|
||||
map = CreateInstance(mapId, newInstanceId, instanceLock, difficulty, player->GetTeamId(), group);
|
||||
map = CreateInstance(mapId, newInstanceId, instanceLock, difficulty, GetTeamIdForTeam(sCharacterCache->GetCharacterTeamByGuid(instanceOwnerGuid)), group);
|
||||
if (group)
|
||||
group->SetRecentInstance(mapId, instanceOwnerGuid, newInstanceId);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user