mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/ArenaTeam: Add a check to determine if a player is account for an accurate calculation of ArenaTeam::GetAverageMMR
Fixes issue #3789 --HG-- branch : trunk
This commit is contained in:
@@ -604,14 +604,24 @@ uint32 ArenaTeam::GetAverageMMR(Group *group) const
|
||||
{
|
||||
if (!group) //should never happen
|
||||
return 0;
|
||||
|
||||
uint32 matchmakerrating = 0;
|
||||
uint32 player_divider = 1;
|
||||
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
if (group->IsMember(itr->guid))
|
||||
matchmakerrating += itr->matchmaker_rating;
|
||||
// If player not online
|
||||
if (!ObjectAccessor::FindPlayer(itr->guid))
|
||||
continue;
|
||||
|
||||
// If not in group
|
||||
if (!group->IsMember(itr->guid))
|
||||
continue;
|
||||
|
||||
matchmakerrating += itr->matchmaker_rating;
|
||||
++player_divider;
|
||||
}
|
||||
|
||||
matchmakerrating /= GetType();
|
||||
matchmakerrating /= player_divider;
|
||||
|
||||
return matchmakerrating;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user