aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-02 16:46:43 -0600
committermegamage <none@none>2009-03-02 16:46:43 -0600
commitf503f320ad6db899cb966fadd5757c71d0c005b1 (patch)
tree40d138558f1662fbdef82da39a7a502032da5ce6 /src
parente73d01182f74110372655d29787dc73de6efedbc (diff)
[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
Diffstat (limited to 'src')
-rw-r--r--src/game/BattleGroundMgr.cpp5
-rw-r--r--src/game/WorldSession.cpp3
-rw-r--r--src/shared/revision_nr.h2
3 files changed, 8 insertions, 2 deletions
diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp
index 987cf4f6a0d..dbd02fad42a 100644
--- a/src/game/BattleGroundMgr.cpp
+++ b/src/game/BattleGroundMgr.cpp
@@ -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
// 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;
@@ -673,6 +674,8 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
if( !bg->HasFreeSlots() )
{
+ if( next == sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].end() )
+ continueAdding = false;
// remove BG from BGFreeSlotQueue
bg->RemoveFromBGFreeSlotQueue();
}
diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp
index bfe9946e7d3..70a864229ea 100644
--- a/src/game/WorldSession.cpp
+++ b/src/game/WorldSession.cpp
@@ -305,6 +305,9 @@ void WorldSession::LogoutPlayer(bool Save)
_player->BuildPlayerRepop();
_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
if(!_player->m_InstanceValid && !_player->isGameMaster())
diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h
index 6149e27cbb2..3f3a2957e35 100644
--- a/src/shared/revision_nr.h
+++ b/src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "7358"
+ #define REVISION_NR "7359"
#endif // __REVISION_NR_H__