[7415] Fixed removing player from battlegrounds

Probably fixed bug with not ending battlegrounds - reported in previous commit message
Fixed player will loose arena rating if
1. he doesn't click on enter rated arena window - and timer will expire
2. he logs out during time he is invited to rated arena match
3. if he logs out during fight in rated arena match
Patch is not tested, i will test it as soon as possible.

Signed-off-by: Triply <triply@getmangos.com>
This commit is contained in:
Triply 2009-03-08 22:12:14 +01:00
parent ee5feab3eb
commit bd0619ce40
7 changed files with 112 additions and 109 deletions

View file

@ -575,6 +575,28 @@ void ArenaTeam::MemberLost(Player * plr, uint32 againstRating)
}
}
void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstRating)
{
// called for offline player after ending rated arena match!
for(MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
{
if(itr->guid == guid)
{
// update personal rating
float chance = GetChanceAgainst(itr->personal_rating, againstRating);
int32 mod = (int32)ceil(32.0f * (0.0f - chance));
if (int32(itr->personal_rating) + mod < 0)
itr->personal_rating = 0;
else
itr->personal_rating += mod;
// update personal played stats
itr->games_week +=1;
itr->games_season +=1;
return;
}
}
}
void ArenaTeam::MemberWon(Player * plr, uint32 againstRating)
{
// called for each participant after winning a match