diff options
author | Subv <subv2112@gmail.com> | 2014-05-31 22:43:11 -0500 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2014-05-31 22:43:11 -0500 |
commit | 6bc62d730ed08e6e12d9b57d4914e98019298781 (patch) | |
tree | ce75f3c1fc8c1d911e528a8f5d74752b1d3d29e3 /src/server/game/Maps/PhaseMgr.cpp | |
parent | 82ff42b081d60a2940025d8a37fe64fed5b76623 (diff) |
Core/Auras: Fixed build and crash from previous commit.
Diffstat (limited to 'src/server/game/Maps/PhaseMgr.cpp')
-rw-r--r-- | src/server/game/Maps/PhaseMgr.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/server/game/Maps/PhaseMgr.cpp b/src/server/game/Maps/PhaseMgr.cpp index 0f542bf5948..13d357702ab 100644 --- a/src/server/game/Maps/PhaseMgr.cpp +++ b/src/server/game/Maps/PhaseMgr.cpp @@ -357,31 +357,27 @@ uint32 PhaseData::RemoveAuraInfo(uint32 spellId) PhaseInfoContainer::const_iterator rAura = spellPhaseInfo.find(spellId); if (rAura != spellPhaseInfo.end()) { - bool serverUpdated = false; - bool clientUpdated = false; uint32 updateflag = 0; for (auto phase = rAura->second.begin(); phase != rAura->second.end(); ++phase) { - if (!clientUpdated && phase->NeedsClientSideUpdate()) - { - clientUpdated = true; + if (phase->NeedsClientSideUpdate()) updateflag |= PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED; - } - if (!serverUpdated && phase->NeedsServerSideUpdate()) + if (phase->NeedsServerSideUpdate()) { - serverUpdated = true; _PhasemaskThroughAuras = 0; - updateflag |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED; + } + } - spellPhaseInfo.erase(rAura); + if (updateflag & PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED) + { + spellPhaseInfo.erase(rAura); - for (PhaseInfoContainer::const_iterator itr = spellPhaseInfo.begin(); itr != spellPhaseInfo.end(); ++itr) - for (auto ph = itr->second.begin(); ph != itr->second.end(); ++ph) - _PhasemaskThroughAuras |= ph->phasemask; - } + for (PhaseInfoContainer::const_iterator itr = spellPhaseInfo.begin(); itr != spellPhaseInfo.end(); ++itr) + for (auto ph = itr->second.begin(); ph != itr->second.end(); ++ph) + _PhasemaskThroughAuras |= ph->phasemask; } return updateflag; |