From 3bbee4172ab475baf142779cd473416e380661c9 Mon Sep 17 00:00:00 2001 From: Trazom62 Date: Thu, 25 Feb 2010 00:26:47 +0100 Subject: [PATCH] Fix crash during BattleGround::EndBattleGround(). Fixes issue #885. + init FirstFlagCaptureTeam at bg reset. --HG-- branch : trunk --- src/game/BattleGround.cpp | 6 +++++- src/game/BattleGroundWS.cpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index b45a996167..e2d6ac0177 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -749,7 +749,10 @@ void BattleGround::EndBattleGround(uint32 winner) } Player *plr = objmgr.GetPlayer(itr->first); if (!plr) + { sLog.outError("BattleGround:EndBattleGround Player (GUID: %u) not found!", GUID_LOPART(itr->first)); + continue; + } // should remove spirit of redemption if(plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION)) @@ -759,7 +762,8 @@ void BattleGround::EndBattleGround(uint32 winner) { plr->ResurrectPlayer(1.0f); plr->SpawnCorpseBones(); - }else + } + else { //needed cause else in av some creatures will kill the players at the end plr->CombatStop(); diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp index d6b25bd247..6ac73567b0 100644 --- a/src/game/BattleGroundWS.cpp +++ b/src/game/BattleGroundWS.cpp @@ -720,6 +720,7 @@ void BattleGroundWS::Reset() m_HonorEndKills = (isBGWeekend) ? 4 : 2; // For WorldState m_minutesElapsed = 0; + m_FirstFlagCaptureTeam = 0; /* Spirit nodes is static at this BG and then not required deleting at BG reset. if (m_BgCreatures[WS_SPIRIT_MAIN_ALLIANCE])