*Do not make deep (ProcDamageAndSpellFor) static.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-20 15:54:51 -05:00
parent 45e61dd4d3
commit 2649b4c44d
2 changed files with 7 additions and 6 deletions

View File

@@ -152,7 +152,7 @@ bool IsPassiveStackableSpell( uint32 spellId )
Unit::Unit()
: WorldObject(), i_motionMaster(this), m_ThreatManager(this), m_HostilRefManager(this)
, m_IsInNotifyList(false), m_Notified(false), IsAIEnabled(false), NeedChangeAI(false)
, i_AI(NULL), i_disabledAI(NULL)
, i_AI(NULL), i_disabledAI(NULL), m_procDeep(0)
{
m_objectType |= TYPEMASK_UNIT;
m_objectTypeId = TYPEID_UNIT;
@@ -11409,16 +11409,15 @@ uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missC
return procEx;
}
static int deep = 0;
void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage )
{
deep ++;
if (deep > 5)
++m_procDeep;
if (++m_procDeep > 5)
{
sLog.outError("Prevent possible stack owerflow in Unit::ProcDamageAndSpellFor");
if (procSpell)
sLog.outError(" Spell %u", procSpell->Id);
deep--;
--m_procDeep;
return;
}
// For melee/ranged based attack need update skills and set some Aura states
@@ -11675,7 +11674,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
for(RemoveSpellList::const_iterator i = removedSpells.begin(); i != removedSpells.end();i++)
RemoveAurasDueToSpell(*i);
}
deep--;
--m_procDeep;
}
SpellSchoolMask Unit::GetMeleeDamageSchoolMask() const

View File

@@ -1532,6 +1532,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
uint32 m_reducedThreatPercent;
uint64 m_misdirectionTargetGUID;
uint32 m_procDeep;
};
namespace Trinity