diff options
author | n0n4m3 <none@none> | 2010-01-16 19:27:15 +0300 |
---|---|---|
committer | n0n4m3 <none@none> | 2010-01-16 19:27:15 +0300 |
commit | 585f4317c129214f852cf182b9a963f89ed9f1e8 (patch) | |
tree | ea1fb065f26cdc4182d0d5a001691d36818a948b | |
parent | 15dc23ad45f20e147dcfc01abd94b438cc0318ea (diff) |
Auto-leave player at login back to bg/arena when bg/arena finished. by VladimirMangos.
--HG--
branch : trunk
-rw-r--r-- | src/game/Player.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 898f0f08f01..a83a17f1f6e 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -15577,7 +15577,9 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) if(m_bgData.bgInstanceID) //saved in BattleGround currentBg = sBattleGroundMgr.GetBattleGround(m_bgData.bgInstanceID, BATTLEGROUND_TYPE_NONE); - if(currentBg && currentBg->IsPlayerInBattleGround(GetGUID())) + bool player_at_bg = currentBg && currentBg->IsPlayerInBattleGround(GetGUID()); + + if(player_at_bg && currentBg->GetStatus() != STATUS_WAIT_LEAVE) { BattleGroundQueueTypeId bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(currentBg->GetTypeID(), currentBg->GetArenaType()); AddBattleGroundQueueId(bgQueueTypeId); @@ -15593,6 +15595,10 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) // Bg was not found - go to Entry Point else { + // leave bg + if (player_at_bg) + currentBg->RemovePlayerAtLeave(GetGUID(), false, true); + // Do not look for instance if bg not found const WorldLocation& _loc = GetBattleGroundEntryPoint(); mapId = _loc.GetMapId(); instanceId = 0; |