[7353] Fixed problem with joining rated arena matches. Thanks to balrok for help.

Signed-off-by: Triply <triply@getmangos.com>
This commit is contained in:
Triply 2009-02-27 14:20:31 +01:00
parent 0be003ac90
commit a81d174288
10 changed files with 99 additions and 72 deletions

View file

@ -366,6 +366,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this)
m_DetectInvTimer = 1000;
m_bgBattleGroundID = 0;
m_bgTypeID = BATTLEGROUND_TYPE_NONE;
for (int j=0; j < PLAYER_MAX_BATTLEGROUND_QUEUES; j++)
{
m_bgBattleGroundQueueID[j].bgQueueTypeId = BATTLEGROUND_QUEUE_NONE;
@ -4242,7 +4243,7 @@ void Player::RepopAtGraveyard()
WorldSafeLocsEntry const *ClosestGrave = NULL;
// Special handle for battleground maps
BattleGround *bg = sBattleGroundMgr.GetBattleGround(GetBattleGroundId());
BattleGround *bg = sBattleGroundMgr.GetBattleGround(GetBattleGroundId(), m_bgTypeID);
if(bg && (bg->GetTypeID() == BATTLEGROUND_AB || bg->GetTypeID() == BATTLEGROUND_EY))
ClosestGrave = bg->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetTeam());
@ -14251,14 +14252,14 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
if(!mapEntry || mapEntry->Instanceable() || !MapManager::IsValidMapCoord(m_bgEntryPoint))
SetBattleGroundEntryPoint(m_homebindMapId,m_homebindX,m_homebindY,m_homebindZ,0.0f);
BattleGround *currentBg = sBattleGroundMgr.GetBattleGround(bgid);
BattleGround *currentBg = sBattleGroundMgr.GetBattleGround(bgid, BATTLEGROUND_TYPE_NONE);
if(currentBg && currentBg->IsPlayerInBattleGround(GetGUID()))
{
BattleGroundQueueTypeId bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(currentBg->GetTypeID(), currentBg->GetArenaType());
uint32 queueSlot = AddBattleGroundQueueId(bgQueueTypeId);
SetBattleGroundId(currentBg->GetInstanceID());
SetBattleGroundId(currentBg->GetInstanceID(), currentBg->GetTypeID());
SetBGTeam(bgteam);
//join player to battleground group
@ -18490,7 +18491,7 @@ BattleGround* Player::GetBattleGround() const
if(GetBattleGroundId()==0)
return NULL;
return sBattleGroundMgr.GetBattleGround(GetBattleGroundId());
return sBattleGroundMgr.GetBattleGround(GetBattleGroundId(), m_bgTypeID);
}
bool Player::InArena() const