aboutsummaryrefslogtreecommitdiff
path: root/src/game/ArenaTeam.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-09 17:07:40 -0600
committermegamage <none@none>2009-03-09 17:07:40 -0600
commitc708eba7131a19ea25065fd8f05b5c556c2a25e2 (patch)
tree9e9982ddbfbef5e3aec4d5c9007286f5e4205749 /src/game/ArenaTeam.cpp
parent1f296b7d40c16e209b8cee6a64c166fef6d4b8fd (diff)
[7415] Fixed removing player from battlegrounds Author: Triply
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. --HG-- branch : trunk
Diffstat (limited to 'src/game/ArenaTeam.cpp')
-rw-r--r--src/game/ArenaTeam.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/game/ArenaTeam.cpp b/src/game/ArenaTeam.cpp
index a556210d4c5..96e279f7d83 100644
--- a/src/game/ArenaTeam.cpp
+++ b/src/game/ArenaTeam.cpp
@@ -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