[11351] Calculate avg. personal rating in more correct way.

This commit is contained in:
VladimirMangos 2011-04-14 15:23:29 +04:00
parent 0912c17cee
commit e605b203e2
2 changed files with 8 additions and 6 deletions

View file

@ -700,16 +700,18 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
// the arena team id must match for everyone in the group // the arena team id must match for everyone in the group
// get the personal ratings for queue // get the personal ratings for queue
uint32 avg_pers_rating = 0; 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 // calc avg personal rating
avg_pers_rating += member->GetArenaPersonalRating(arenaslot); avg_pers_rating += at_member->personal_rating;
} }
if (arenatype) avg_pers_rating /= grp->GetMembersCount();
avg_pers_rating /= arenatype;
// 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 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) if (avg_pers_rating + 150 < arenaRating)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11350" #define REVISION_NR "11351"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__