Skip to content

Commit

Permalink
[8913] Fixed typo in recent Spell::EffectDispel code changes.
Browse files Browse the repository at this point in the history
Also some code cleanup.
  • Loading branch information
VladimirMangos committed Dec 3, 2009
1 parent b8823de commit 57cf96c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/game/SpellEffects.cpp
Expand Up @@ -3613,21 +3613,23 @@ void Spell::EffectDispel(uint32 i)
{
std::list < std::pair<uint32,uint64> > success_list;// (spell_id,casterGuid)
std::list < uint32 > fail_list; // spell_id
int32 list_size = dispel_list.size();

// some spells have effect value = 0 and all from its by meaning expect 1
if(!damage)
damage = 1;

// Dispell N = damage buffs (or while exist buffs for dispel)
for (int32 count=0; count < damage && list_size > 0; ++count)
for (int32 count=0; count < damage && !dispel_list.empty(); ++count)
{
// Random select buff for dispel
std::vector<Aura*>::iterator dispel_itr = dispel_list.begin();
std::advance(dispel_itr,urand(0, list_size-1));
std::advance(dispel_itr,urand(0, dispel_list.size()-1));

Aura *aur = *dispel_itr;

// remove entry from dispel_list
dispel_list.erase(dispel_itr);

SpellEntry const* spellInfo = aur->GetSpellProto();
// Base dispel chance
// TODO: possible chance depend from spell level??
Expand All @@ -3643,9 +3645,6 @@ void Spell::EffectDispel(uint32 i)
fail_list.push_back(spellInfo->Id);
else
success_list.push_back(std::pair<uint32,uint64>(aur->GetId(),aur->GetCasterGUID()));

// remove entry from dispel_list
dispel_list.erase(dispel_itr);
}
// Send success log and really remove auras
if (!success_list.empty())
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8912"
#define REVISION_NR "8913"
#endif // __REVISION_NR_H__

0 comments on commit 57cf96c

Please sign in to comment.