Core/Spells: Implement CREATURE_TYPEFLAGS_PROJECTILE_COLLISION, and solve some targeting problems with TARGET_DEST_TRAJ
This commit is contained in:
1 parent
17f91aee76
commit
78ffaf6ca6
2 files changed
+16
-2
No files matched your search
@@ -1514,10 +1514,24 @@ void Spell::SelectImplicitTrajTargets(SpellEffIndex effIndex)
|
||||
std::list<WorldObject*>::const_iterator itr = targets.begin();
|
||||
for (; itr != targets.end(); ++itr)
|
||||
{
|
||||
if (!m_caster->HasInLine(*itr, 5.0f))
|
||||
continue;
|
||||
|
||||
if (m_spellInfo->CheckTarget(m_caster, *itr, true) != SPELL_CAST_OK)
|
||||
continue;
|
||||
|
||||
if (Unit* unitTarget = (*itr)->ToUnit())
|
||||
if (m_caster == *itr || m_caster->IsOnVehicle(unitTarget) || (unitTarget)->GetVehicle())//(*itr)->IsOnVehicle(m_caster))
|
||||
{
|
||||
if (m_caster == *itr || m_caster->IsOnVehicle(unitTarget) || unitTarget->GetVehicle())
|
||||
continue;
|
||||
|
||||
if (Creature* creatureTarget = unitTarget->ToCreature())
|
||||
{
|
||||
if (!(creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PROJECTILE_COLLISION))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
const float size = std::max((*itr)->GetObjectSize() * 0.7f, 1.0f); // 1/sqrt(3)
|
||||
/// @todo all calculation should be based on src instead of m_caster
|
||||
const float objDist2d = m_targets.GetSrcPos()->GetExactDist2d(*itr) * std::cos(m_targets.GetSrcPos()->GetRelativeAngle(*itr));
|
||||
|
||||
Reference in new issue
Block a user