Core/ObjectMgr: Refactor arena team related functions into dedicated class
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "Log.h"
|
||||
#include "Group.h"
|
||||
|
||||
@@ -158,7 +159,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg
|
||||
//announce world (this don't need mutex)
|
||||
if (isRated && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
{
|
||||
ArenaTeam *Team = sObjectMgr->GetArenaTeamById(arenateamid);
|
||||
ArenaTeam *Team = sArenaTeamMgr->GetArenaTeamById(arenateamid);
|
||||
if (Team)
|
||||
sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
|
||||
}
|
||||
@@ -353,7 +354,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
|
||||
// announce to world if arena team left queue for rated match, show only once
|
||||
if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
{
|
||||
ArenaTeam *Team = sObjectMgr->GetArenaTeamById(group->ArenaTeamId);
|
||||
ArenaTeam *Team = sArenaTeamMgr->GetArenaTeamById(group->ArenaTeamId);
|
||||
if (Team)
|
||||
sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, Team->GetName().c_str(), group->ArenaType, group->ArenaType, group->ArenaTeamRating);
|
||||
}
|
||||
@@ -361,7 +362,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
|
||||
//if player leaves queue and he is invited to rated arena match, then he have to lose
|
||||
if (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount)
|
||||
{
|
||||
ArenaTeam * at = sObjectMgr->GetArenaTeamById(group->ArenaTeamId);
|
||||
ArenaTeam * at = sArenaTeamMgr->GetArenaTeamById(group->ArenaTeamId);
|
||||
if (at)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating);
|
||||
|
||||
Reference in New Issue
Block a user