mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[8339] Improved storing/restoring BG entry point
* Introduced new table character_battleground_data * Entry point is now stored on BG enter event not join event * Entry point for dungeons is now correctly set to nearest graveyard (this prevent well known assert in GetInstance because of porting to already destroyed instance) * Teleporting from BG correctly restore mount state * Teleporting from BG correctly restore taxi flight (in multipath flight you will end up in nearest transition point on the route) Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
parent
5c2ae96e38
commit
6d9448dd7f
12 changed files with 328 additions and 160 deletions
|
|
@ -161,9 +161,6 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
|
|||
|
||||
uint32 queueSlot = member->AddBattleGroundQueueId(bgQueueTypeId); // add to queue
|
||||
|
||||
// store entry point coords
|
||||
member->SetBattleGroundEntryPoint(member->GetMapId(),member->GetPositionX(),member->GetPositionY(),member->GetPositionZ(),member->GetOrientation());
|
||||
|
||||
WorldPacket data;
|
||||
// send status packet (in queue)
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType);
|
||||
|
|
@ -179,8 +176,6 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
|
|||
{
|
||||
// already checked if queueSlot is valid, now just get it
|
||||
uint32 queueSlot = _player->AddBattleGroundQueueId(bgQueueTypeId);
|
||||
// store entry point coords
|
||||
_player->SetBattleGroundEntryPoint(_player->GetMapId(),_player->GetPositionX(),_player->GetPositionY(),_player->GetPositionZ(),_player->GetOrientation());
|
||||
|
||||
WorldPacket data;
|
||||
// send status packet (in queue)
|
||||
|
|
@ -435,6 +430,9 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
|
|||
case 1: // port to battleground
|
||||
if (!_player->IsInvitedForBattleGroundQueueType(bgQueueTypeId))
|
||||
return; // cheating?
|
||||
|
||||
_player->SetBattleGroundEntryPoint();
|
||||
|
||||
// resurrect the player
|
||||
if (!_player->isAlive())
|
||||
{
|
||||
|
|
@ -751,9 +749,6 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
|||
|
||||
uint32 queueSlot = member->AddBattleGroundQueueId(bgQueueTypeId);// add to queue
|
||||
|
||||
// store entry point coords (same as leader entry point)
|
||||
member->SetBattleGroundEntryPoint(_player->GetMapId(),_player->GetPositionX(),_player->GetPositionY(),_player->GetPositionZ(),_player->GetOrientation());
|
||||
|
||||
WorldPacket data;
|
||||
// send status packet (in queue)
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype);
|
||||
|
|
@ -771,9 +766,6 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
|||
{
|
||||
uint32 queueSlot = _player->AddBattleGroundQueueId(bgQueueTypeId);
|
||||
|
||||
// store entry point coords
|
||||
_player->SetBattleGroundEntryPoint(_player->GetMapId(),_player->GetPositionX(),_player->GetPositionY(),_player->GetPositionZ(),_player->GetOrientation());
|
||||
|
||||
WorldPacket data;
|
||||
// send status packet (in queue)
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue