[7045] Some additional check

More correct spell select for creatures if spell PreventionType == SPELL_PREVENTION_TYPE_SILENCE
Also add check for PreventionType == SPELL_PREVENTION_TYPE_PACIFY

Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
DiSlord 2009-01-07 17:59:12 +03:00
parent ccdad44e6c
commit d12944d8f2
2 changed files with 7 additions and 3 deletions

View file

@ -1596,7 +1596,9 @@ SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim)
// continue;
if( dist > range || dist < minrange )
continue;
if(HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
if(spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
continue;
if(spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
continue;
return spellInfo;
}
@ -1640,7 +1642,9 @@ SpellEntry const *Creature::reachWithSpellCure(Unit *pVictim)
// continue;
if( dist > range || dist < minrange )
continue;
if(HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
if(spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
continue;
if(spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
continue;
return spellInfo;
}