mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[8913] Fixed typo in recent Spell::EffectDispel code changes.
Also some code cleanup.
This commit is contained in:
parent
edd4492630
commit
76ad6efef0
2 changed files with 6 additions and 7 deletions
|
|
@ -3613,21 +3613,23 @@ void Spell::EffectDispel(uint32 i)
|
||||||
{
|
{
|
||||||
std::list < std::pair<uint32,uint64> > success_list;// (spell_id,casterGuid)
|
std::list < std::pair<uint32,uint64> > success_list;// (spell_id,casterGuid)
|
||||||
std::list < uint32 > fail_list; // spell_id
|
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
|
// some spells have effect value = 0 and all from its by meaning expect 1
|
||||||
if(!damage)
|
if(!damage)
|
||||||
damage = 1;
|
damage = 1;
|
||||||
|
|
||||||
// Dispell N = damage buffs (or while exist buffs for dispel)
|
// 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
|
// Random select buff for dispel
|
||||||
std::vector<Aura*>::iterator dispel_itr = dispel_list.begin();
|
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;
|
Aura *aur = *dispel_itr;
|
||||||
|
|
||||||
|
// remove entry from dispel_list
|
||||||
|
dispel_list.erase(dispel_itr);
|
||||||
|
|
||||||
SpellEntry const* spellInfo = aur->GetSpellProto();
|
SpellEntry const* spellInfo = aur->GetSpellProto();
|
||||||
// Base dispel chance
|
// Base dispel chance
|
||||||
// TODO: possible chance depend from spell level??
|
// TODO: possible chance depend from spell level??
|
||||||
|
|
@ -3643,9 +3645,6 @@ void Spell::EffectDispel(uint32 i)
|
||||||
fail_list.push_back(spellInfo->Id);
|
fail_list.push_back(spellInfo->Id);
|
||||||
else
|
else
|
||||||
success_list.push_back(std::pair<uint32,uint64>(aur->GetId(),aur->GetCasterGUID()));
|
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
|
// Send success log and really remove auras
|
||||||
if (!success_list.empty())
|
if (!success_list.empty())
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8912"
|
#define REVISION_NR "8913"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue