Jump to content

[alt.patch added in 7300] Crash fix of BattleGroundMgr::RemovePlayer


Alex

Recommended Posts

Patch for rev: about rev.7294 this crash was discovered

Simple single-line fix for buggy check.

--- BattleGroundMgr.cpp     2009-02-16 23:19:15.000000000 +0300
+++ BattleGroundMgr.cpp 2009-02-18 23:25:59.000000000 +0300
@@ -260,7 +260,7 @@
    }

    // couldn't find the player in bg queue, return
-    if(itr == m_QueuedPlayers[queue_id].end())
+    if(queue_id < 0)
    {
        sLog.outError("Battleground: couldn't find player to remove.");
        return;

---

The check will go wrong here, because after

    for (queue_id = MAX_BATTLEGROUND_QUEUES-1; queue_id >= 0; queue_id--)
   {
       itr = m_QueuedPlayers[queue_id].find(guid);
       if(itr != m_QueuedPlayers[queue_id].end())
           break;
   }

if no player is found, it will have -1 in queue_id, so m_QueuedPlayers[queue_id] has no sense.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use