mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
Creature type flags (#2195)
fix(Core/Creature): refactoring creature type flags and adding CREATURE_TYPE_FLAG_CAN_COLLIDE_WITH_MISSILES - closes #1984
This commit is contained in:
@@ -1844,9 +1844,17 @@ void Spell::SelectImplicitTrajTargets(SpellEffIndex effIndex, SpellImplicitTarge
|
||||
for (; itr != targets.end(); ++itr)
|
||||
{
|
||||
if (Unit* unitTarget = (*itr)->ToUnit())
|
||||
{
|
||||
if (m_caster == *itr || m_caster->IsOnVehicle(unitTarget) || (unitTarget)->GetVehicle())//(*itr)->IsOnVehicle(m_caster))
|
||||
continue;
|
||||
|
||||
if (Creature * creatureTarget = unitTarget->ToCreature())
|
||||
{
|
||||
if (!(creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_CAN_COLLIDE_WITH_MISSILES))
|
||||
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 = fabs(m_targets.GetSrcPos()->GetExactDist2d(*itr) * cos(m_targets.GetSrcPos()->GetRelativeAngle(*itr)));
|
||||
|
||||
Reference in New Issue
Block a user