mirror of
https://github.com/mangosfour/server.git
synced 2026-01-01 07:37:07 +00:00
[7359] Fixed crash when removing battleground from BGFreeSlotQueue.
Fixed player will now drop a flag before he logs out, if he is in BG. Signed-off-by: Triply <triply@getmangos.com>
This commit is contained in:
parent
2791d5a6d3
commit
4994611582
3 changed files with 8 additions and 2 deletions
|
|
@ -644,8 +644,9 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
|
|||
|
||||
//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
|
||||
bool continueAdding = true;
|
||||
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;
|
||||
|
|
@ -671,6 +672,8 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
|
|||
|
||||
if( !bg->HasFreeSlots() )
|
||||
{
|
||||
if( next == sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].end() )
|
||||
continueAdding = false;
|
||||
// remove BG from BGFreeSlotQueue
|
||||
bg->RemoveFromBGFreeSlotQueue();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue