Skip to content

Commit

Permalink
Core/Arena: arena rating display corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
zgn1988 authored and Zaffy committed Nov 20, 2016
1 parent 60abae9 commit 3a63d32
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions src/game/BattlegroundMgr.cpp
Expand Up @@ -1162,21 +1162,16 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
if (type) // arena
{
// it seems this must be according to BG_WINNER_A/H and _NOT_ BG_TEAM_A/H
for (int8 i = 1; i >= 0; --i)
{
*data << uint32(3000 - bg->m_ArenaTeamRatingChanges[i]); // rating change: showed value - 3000
*data << uint32(3999); // huge thanks for TOM_RUS for this!
sLog.outDebug("rating change: %d", bg->m_ArenaTeamRatingChanges[i]);
}
for (int8 i = 1; i >= 0; --i)
{
uint32 at_id = bg->m_ArenaTeamIds[i];
ArenaTeam* at = sObjectMgr.GetArenaTeamById(at_id);
if (at)
*data << at->GetName();
else
*data << uint8(0);
}
ArenaTeam* at1 = sObjectMgr.GetArenaTeamById(bg->m_ArenaTeamIds[1]); // Winner
ArenaTeam* at2 = sObjectMgr.GetArenaTeamById(bg->m_ArenaTeamIds[0]); // Loser

*data << uint32(at1 ? uint32(at1->GetRating()) : 0);
*data << uint32(at1 ? uint32(at1->GetRating() + bg->m_ArenaTeamRatingChanges[1]) : 0);
*data << uint32(at2 ? uint32(at2->GetRating()) : 0);
*data << uint32(at2 ? uint32(at2->GetRating() + bg->m_ArenaTeamRatingChanges[0]) : 0);

*data << (at1 ? at1->GetName() : "Unknown");
*data << (at2 ? at2->GetName() : "Unknown");
}

if (bg->GetWinner() == 2)
Expand Down

0 comments on commit 3a63d32

Please sign in to comment.