Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
This commit is contained in:
commit
3c5bf554ff
13 files changed
+64
-41
No files matched your search
@@ -5189,26 +5189,23 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (m_caster->HasUnitState(UNIT_STATE_ROOT))
|
||||
return SPELL_FAILED_ROOTED;
|
||||
|
||||
Unit* target = m_targets.GetUnitTarget();
|
||||
if (GetSpellInfo()->NeedsExplicitUnitTarget())
|
||||
{
|
||||
Unit* target = m_targets.GetUnitTarget();
|
||||
if (!target)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
if (!target)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (!target->isAlive())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
Position pos;
|
||||
target->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
target->GetFirstCollisionPosition(pos, CONTACT_DISTANCE, target->GetRelativeAngle(m_caster));
|
||||
|
||||
m_preGeneratedPath.SetPathLengthLimit(m_spellInfo->GetMaxRange(true) * 1.5f);
|
||||
bool result = m_preGeneratedPath.CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ + target->GetObjectSize());
|
||||
if (m_preGeneratedPath.GetPathType() & PATHFIND_SHORT)
|
||||
return SPELL_FAILED_OUT_OF_RANGE;
|
||||
else if (!result)
|
||||
return SPELL_FAILED_NOPATH;
|
||||
Position pos;
|
||||
target->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
target->GetFirstCollisionPosition(pos, CONTACT_DISTANCE, target->GetRelativeAngle(m_caster));
|
||||
|
||||
m_preGeneratedPath.SetPathLengthLimit(m_spellInfo->GetMaxRange(true) * 1.5f);
|
||||
bool result = m_preGeneratedPath.CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ + target->GetObjectSize());
|
||||
if (m_preGeneratedPath.GetPathType() & PATHFIND_SHORT)
|
||||
return SPELL_FAILED_OUT_OF_RANGE;
|
||||
else if (!result || m_preGeneratedPath.GetPathType() & PATHFIND_NOPATH)
|
||||
return SPELL_FAILED_NOPATH;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_SKINNING:
|
||||
|
||||
Reference in new issue
Block a user