mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
Get Team Id by group Leader instead of random player
This commit is contained in:
@@ -91,9 +91,11 @@ public:
|
||||
if (TeamIdInInstance == TEAM_NEUTRAL)
|
||||
{
|
||||
Map::PlayerList const &players = instance->GetPlayers();
|
||||
if( !players.isEmpty() )
|
||||
if( Player* pPlayer = players.begin()->GetSource() )
|
||||
TeamIdInInstance = pPlayer->GetTeamId();
|
||||
if (!players.isEmpty())
|
||||
if (Player* pPlayer = players.begin()->GetSource())
|
||||
if (Group * group = pPlayer->GetGroup())
|
||||
if(Player* groupLeader = ObjectAccessor::GetPlayer(*pPlayer,group->GetLeaderGUID()))
|
||||
TeamIdInInstance = groupLeader->GetTeamId();
|
||||
}
|
||||
|
||||
switch( creature->GetEntry() )
|
||||
|
||||
Reference in New Issue
Block a user