Core/Arena: Fix an exploit which made you gain personal rating when you leave arena, and add some comments to the arena system (which I should have done way earlier).
--HG-- branch : trunk
This commit is contained in:
@@ -644,6 +644,7 @@ int32 ArenaTeam::GetRatingMod(uint32 own_rating, uint32 enemy_rating, bool won,
|
||||
|
||||
int32 ArenaTeam::GetPersonalRatingMod(int32 base_rating, uint32 own_rating, uint32 enemy_rating)
|
||||
{
|
||||
// max (2 * team rating gain/loss), min 0 gain/loss
|
||||
float chance = GetChanceAgainst(own_rating, enemy_rating);
|
||||
chance *= 2.0f;
|
||||
return (int32)ceil(float(base_rating) * chance);
|
||||
@@ -671,6 +672,7 @@ void ArenaTeam::FinishGame(int32 mod)
|
||||
int32 ArenaTeam::WonAgainst(uint32 againstRating)
|
||||
{
|
||||
// called when the team has won
|
||||
// own team rating versus opponents matchmaker rating
|
||||
int32 mod = GetRatingMod(m_stats.rating, againstRating, true);
|
||||
|
||||
// modify the team stats accordingly
|
||||
@@ -685,6 +687,7 @@ int32 ArenaTeam::WonAgainst(uint32 againstRating)
|
||||
int32 ArenaTeam::LostAgainst(uint32 againstRating)
|
||||
{
|
||||
// called when the team has lost
|
||||
// own team rating versus opponents matchmaker rating
|
||||
int32 mod = GetRatingMod(m_stats.rating, againstRating, false);
|
||||
|
||||
// modify the team stats accordingly
|
||||
|
||||
@@ -201,7 +201,7 @@ class ArenaTeam
|
||||
int32 WonAgainst(uint32 againstRating);
|
||||
void MemberWon(Player * plr, uint32 againstMatchmakerRating, int32 teamratingchange = 12);
|
||||
int32 LostAgainst(uint32 againstRating);
|
||||
void MemberLost(Player * plr, uint32 againstMatchmakerRating, int32 teamratingchange = 12);
|
||||
void MemberLost(Player * plr, uint32 againstMatchmakerRating, int32 teamratingchange = -12);
|
||||
void OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, int32 teamratingchange = 12);
|
||||
|
||||
void UpdateArenaPointsHelper(std::map<uint32, uint32> & PlayerPoints);
|
||||
|
||||
Reference in New Issue
Block a user