Fix crash during BattleGround::EndBattleGround().

Fixes issue #885.

+ init FirstFlagCaptureTeam at bg reset.

--HG--
branch : trunk
This commit is contained in:
Trazom62
2010-02-25 00:26:47 +01:00
parent 1e7f50b3f6
commit 3bbee4172a
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -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();
+1
View File
@@ -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])