Minor changes for HandleBattleFieldPortOpcode

This commit is contained in:
Yehonal
2016-08-08 11:49:33 +02:00
parent e896daee11
commit 4578edcc2f

View File

@@ -433,6 +433,8 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
_player->SpawnCorpseBones();
}
TeamId teamId = ginfo.teamId;
// remove player from all bg queues
for (uint32 qslot = 0; qslot < PLAYER_MAX_BATTLEGROUND_QUEUES; ++qslot)
if (BattlegroundQueueTypeId q = _player->GetBattlegroundQueueTypeId(qslot))
@@ -443,10 +445,10 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
}
// send status packet
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType(), ginfo.teamId);
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType(), teamId);
SendPacket(&data);
_player->SetBattlegroundId(bg->GetInstanceID(), bg->GetBgTypeID(), queueSlot, true, bgTypeId == BATTLEGROUND_RB, ginfo.teamId);
_player->SetBattlegroundId(bg->GetInstanceID(), bg->GetBgTypeID(), queueSlot, true, bgTypeId == BATTLEGROUND_RB, teamId);
sBattlegroundMgr->SendToBattleground(_player, ginfo.IsInvitedToBGInstanceGUID, bgTypeId);
}