[7359] Fixed crash when removing battleground from BGFreeSlotQueue. Author: Triply
Fixed player will now drop a flag before he logs out, if he is in BG. --HG-- branch : trunk
This commit is contained in:
@@ -646,8 +646,9 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
|
|||||||
|
|
||||||
//battleground with free slot for player should be always in the beggining of the queue
|
//battleground with free slot for player should be always in the beggining of the queue
|
||||||
// maybe it would be better to create bgfreeslotqueue for each queue_id_based_on_level
|
// maybe it would be better to create bgfreeslotqueue for each queue_id_based_on_level
|
||||||
|
bool continueAdding = true;
|
||||||
BGFreeSlotQueueType::iterator itr, next;
|
BGFreeSlotQueueType::iterator itr, next;
|
||||||
for (itr = sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].begin(); itr != sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].end(); itr = next)
|
for (itr = sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].begin(); continueAdding && itr != sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].end(); itr = next)
|
||||||
{
|
{
|
||||||
next = itr;
|
next = itr;
|
||||||
++next;
|
++next;
|
||||||
@@ -673,6 +674,8 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
|
|||||||
|
|
||||||
if( !bg->HasFreeSlots() )
|
if( !bg->HasFreeSlots() )
|
||||||
{
|
{
|
||||||
|
if( next == sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].end() )
|
||||||
|
continueAdding = false;
|
||||||
// remove BG from BGFreeSlotQueue
|
// remove BG from BGFreeSlotQueue
|
||||||
bg->RemoveFromBGFreeSlotQueue();
|
bg->RemoveFromBGFreeSlotQueue();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -305,6 +305,9 @@ void WorldSession::LogoutPlayer(bool Save)
|
|||||||
_player->BuildPlayerRepop();
|
_player->BuildPlayerRepop();
|
||||||
_player->RepopAtGraveyard();
|
_player->RepopAtGraveyard();
|
||||||
}
|
}
|
||||||
|
//drop a flag if player is carrying it
|
||||||
|
if(BattleGround *bg = _player->GetBattleGround())
|
||||||
|
bg->EventPlayerDroppedFlag(_player);
|
||||||
|
|
||||||
///- Teleport to home if the player is in an invalid instance
|
///- Teleport to home if the player is in an invalid instance
|
||||||
if(!_player->m_InstanceValid && !_player->isGameMaster())
|
if(!_player->m_InstanceValid && !_player->isGameMaster())
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7358"
|
#define REVISION_NR "7359"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|||||||
Reference in New Issue
Block a user