Fix work for some auras if used mod set duration to 0

Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
DiSlord 2009-02-15 15:38:43 +03:00
parent 74fdc7bee7
commit 12e27aecee

View file

@ -405,7 +405,12 @@ m_updated(false), m_isRemovedOnShapeLost(true), m_in_use(false)
Player* modOwner = caster ? caster->GetSpellModOwner() : NULL;
if(!m_permanent && modOwner)
{
modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, m_maxduration);
// Get zero duration aura after - need set m_maxduration > 0 for apply/remove aura work
if (m_maxduration<=0)
m_maxduration = 1;
}
m_duration = m_maxduration;
@ -1768,11 +1773,8 @@ void Aura::TriggerSpell()
{
// Invisibility
case 66:
{
if(!m_duration)
m_target->CastSpell(m_target, 32612, true, NULL, this);
// Here need periodic triger reducing threat spell (or do it manually)
return;
}
default:
break;
}
@ -4036,6 +4038,11 @@ void Aura::HandleAuraModStalked(bool apply, bool Real)
void Aura::HandlePeriodicTriggerSpell(bool apply, bool Real)
{
m_isPeriodic = apply;
if (m_spellProto->Id == 66 && !apply)
{
if (m_removeMode == AURA_REMOVE_BY_DEFAULT && m_duration<=0)
m_target->CastSpell(m_target, 32612, true, NULL, this);
}
}
void Aura::HandlePeriodicTriggerSpellWithValue(bool apply, bool Real)