aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Battlegrounds/ArenaTeam.cpp
diff options
context:
space:
mode:
authorLiberate <none@none>2010-08-28 23:17:09 +0200
committerLiberate <none@none>2010-08-28 23:17:09 +0200
commit453476e2c38dc692c8f109211ebe1805f2b54b0c (patch)
treeded88a180fdc5d146e80dc01526573d34154ada9 /src/server/game/Battlegrounds/ArenaTeam.cpp
parent511e8c5acf18063233d2130aed54e7798d8511cb (diff)
Fixes the huge personal rating gained. Damned typos.
Also changes the max rating loss from 48 to 24 when under 1000 rating. Only the max rating gain is 48. Huge thanks to Gyullo for giving me lots of info which led to finding this hidden typo. Thanks go to click and Shocker as well for helping me find this issue. Now, please, is it finished yet? is it finally over? --HG-- branch : trunk
Diffstat (limited to 'src/server/game/Battlegrounds/ArenaTeam.cpp')
-rw-r--r--src/server/game/Battlegrounds/ArenaTeam.cpp32
1 files changed, 7 insertions, 25 deletions
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index a42ff9ffa72..9aaa670ad75 100644
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -621,9 +621,9 @@ float ArenaTeam::GetChanceAgainst(uint32 own_rating, uint32 enemy_rating)
// returns the chance to win against a team with the given rating, used in the rating adjustment calculation
// ELO system
- if (sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID) >= 6)
+/* if (sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID) >= 6)
if (enemy_rating < 1000)
- enemy_rating = 1000;
+ enemy_rating = 1000;*/
return 1.0f/(1.0f+exp(log(10.0f)*(float)((float)enemy_rating - (float)own_rating)/400.0f));
}
@@ -657,7 +657,7 @@ int32 ArenaTeam::WonAgainst(uint32 againstRating)
if (m_stats.rating < 1000)
mod = (int32)ceil(48.0f * (1.0f - chance));
else if (m_stats.rating < 1300)
- mod = (int32)ceil((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (1.0f - chance));
+ mod = (int32)ceil((24.0f + (24.0f * (1300.0f - int32(m_stats.rating)) / 300.0f)) * (1.0f - chance));
else
mod = (int32)ceil(24.0f * (1.0f - chance));
@@ -678,13 +678,7 @@ int32 ArenaTeam::LostAgainst(uint32 againstRating)
// calculate the rating lost
// there is not much info on the formula, but this is a very good simulation
- int32 mod;
- if (m_stats.rating < 1000)
- mod = (int32)floor(48.0f * (0.0f - chance));
- else if (m_stats.rating < 1300)
- mod = (int32)floor((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (0.0f - chance));
- else
- mod = (int32)floor(24.0f * (0.0f - chance));
+ int32 mod = (int32)floor(24.0f * (0.0f - chance));
// modify the team stats accordingly
FinishGame(mod);
@@ -703,13 +697,7 @@ void ArenaTeam::MemberLost(Player * plr, uint32 againstMatchmakerRating)
// update personal rating
float chance = GetChanceAgainst(itr->personal_rating, m_stats.rating);
// calculate the rating modification
- int32 mod;
- if (itr->personal_rating < 1000)
- mod = (int32)floor(48.0f * (0.0f - chance));
- else if (itr->personal_rating < 1300)
- mod = (int32)floor((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (0.0f - chance));
- else
- mod = (int32)floor(24.0f * (0.0f - chance));
+ int32 mod = (int32)floor(24.0f * (0.0f - chance));
itr->ModifyPersonalRating(plr, mod, GetSlot());
// update matchmaker rating
chance = GetChanceAgainst(itr->matchmaker_rating, againstMatchmakerRating);
@@ -737,13 +725,7 @@ void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating)
// update personal rating
float chance = GetChanceAgainst(itr->personal_rating, m_stats.rating);
// calculate the rating modification
- int32 mod;
- if (itr->personal_rating < 1000)
- mod = (int32)floor(48.0f * (0.0f - chance));
- else if (itr->personal_rating < 1300)
- mod = (int32)floor((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (0.0f - chance));
- else
- mod = (int32)floor(24.0f * (0.0f - chance));
+ int32 mod = (int32)floor(24.0f * (0.0f - chance));
itr->ModifyPersonalRating(NULL, mod, GetSlot());
// update matchmaker rating
chance = GetChanceAgainst(itr->matchmaker_rating, againstMatchmakerRating);
@@ -773,7 +755,7 @@ void ArenaTeam::MemberWon(Player * plr, uint32 againstMatchmakerRating)
if (itr->personal_rating < 1000)
mod = (int32)ceil(48.0f * (1.0f - chance));
else if (itr->personal_rating < 1300)
- mod = (int32)ceil((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (1.0f - chance));
+ mod = (int32)ceil((24.0f + (24.0f * (1300.0f - int32(itr->personal_rating)) / 300.0f)) * (1.0f - chance));
else
mod = (int32)ceil(24.0f * (1.0f - chance));
itr->ModifyPersonalRating(plr, mod, GetSlot());