mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-14 20:22:23 -04:00
Core/ScriptedAI: remove ScriptedAI::CanCast function which is not functioning properly (compare that func with Spell::CheckCast to see how it should work) and is unused. Closes #2275.
This commit is contained in:
@@ -269,27 +269,6 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec
|
||||
return apSpell[urand(0, spellCount - 1)];
|
||||
}
|
||||
|
||||
bool ScriptedAI::CanCast(Unit* target, SpellInfo const* spell, bool triggered /*= false*/)
|
||||
{
|
||||
//No target so we can't cast
|
||||
if (!target || !spell)
|
||||
return false;
|
||||
|
||||
//Silenced so we can't cast
|
||||
if (!triggered && me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
|
||||
return false;
|
||||
|
||||
//Check for power
|
||||
if (!triggered && me->GetPower(Powers(spell->PowerType)) < spell->ManaCost)
|
||||
return false;
|
||||
|
||||
//Unit is out of range of this spell
|
||||
if (me->IsInRange(target, float(me->GetSpellMinRangeForTarget(target, spell)), float(me->GetSpellMaxRangeForTarget(target, spell))))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScriptedAI::DoResetThreat()
|
||||
{
|
||||
if (!me->CanHaveThreatList() || me->getThreatManager().isThreatListEmpty())
|
||||
|
||||
Reference in New Issue
Block a user