Skip to content

Commit

Permalink
[11351] Calculate avg. personal rating in more correct way.
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirMangos committed Apr 14, 2011
1 parent 03f8f79 commit 6577255
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/game/BattleGroundHandler.cpp
Expand Up @@ -700,16 +700,18 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
// the arena team id must match for everyone in the group
// get the personal ratings for queue
uint32 avg_pers_rating = 0;
for(GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())

for(Group::member_citerator citr = grp->GetMemberSlots().begin(); citr != grp->GetMemberSlots().end(); ++citr)
{
Player *member = itr->getSource();
ArenaTeamMember const* at_member = at->GetMember(citr->guid);
if (!at_member) // group member joining to arena must be in leader arena team
return;

// calc avg personal rating
avg_pers_rating += member->GetArenaPersonalRating(arenaslot);
avg_pers_rating += at_member->personal_rating;
}

if (arenatype)
avg_pers_rating /= arenatype;
avg_pers_rating /= grp->GetMembersCount();

// if avg personal rating is more than 150 points below the teams rating, the team will be queued against an opponent matching or similar to the average personal rating
if (avg_pers_rating + 150 < arenaRating)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11350"
#define REVISION_NR "11351"
#endif // __REVISION_NR_H__

0 comments on commit 6577255

Please sign in to comment.