From 6a504b983c6e5f1653f81574669bd4dcfb17c7a3 Mon Sep 17 00:00:00 2001 From: Liberate Date: Thu, 7 Oct 2010 16:35:08 +0200 Subject: [PATCH] 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 --- src/server/game/Battlegrounds/ArenaTeam.cpp | 3 +++ src/server/game/Battlegrounds/ArenaTeam.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index a1d3174781..4823b159d1 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -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 diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h index 87c49f09b9..9a9c9ab40d 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.h +++ b/src/server/game/Battlegrounds/ArenaTeam.h @@ -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 & PlayerPoints);