mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/Spells: Replace MovePosition by MovePositionToFirstCollision in spell dest target handling.
- Solves issues such as being able to summon creatures inside terrain/gameobjects, being able to fall through terrain by using Shadowstep/Feral Charge (Cat), and much more
This commit is contained in:
@@ -1288,10 +1288,7 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
|
||||
dist = objSize + (dist - objSize) * float(rand_norm());
|
||||
|
||||
Position pos = dest._position;
|
||||
if (targetType.GetTarget() == TARGET_DEST_CASTER_FRONT_LEAP)
|
||||
m_caster->MovePositionToFirstCollision(pos, dist, angle);
|
||||
else
|
||||
m_caster->MovePosition(pos, dist, angle);
|
||||
m_caster->MovePositionToFirstCollision(pos, dist, angle);
|
||||
|
||||
dest.Relocate(pos);
|
||||
break;
|
||||
@@ -1324,7 +1321,7 @@ void Spell::SelectImplicitTargetDestTargets(SpellEffIndex effIndex, SpellImplici
|
||||
dist = objSize + (dist - objSize) * float(rand_norm());
|
||||
|
||||
Position pos = dest._position;
|
||||
target->MovePosition(pos, dist, angle);
|
||||
target->MovePositionToFirstCollision(pos, dist, angle);
|
||||
|
||||
dest.Relocate(pos);
|
||||
break;
|
||||
@@ -1363,7 +1360,7 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT
|
||||
dist *= float(rand_norm());
|
||||
|
||||
Position pos = dest._position;
|
||||
m_caster->MovePosition(pos, dist, angle);
|
||||
m_caster->MovePositionToFirstCollision(pos, dist, angle);
|
||||
|
||||
dest.Relocate(pos);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user