Core/Spells: Fixed calling spellhit script hooks on launch when spell hits both caster and target with different effects
Port From (https://github.com/TrinityCore/TrinityCore/commit/04ab611111824c7709582637660d01eb117fe9fc)
This commit is contained in:
@@ -4114,14 +4114,14 @@ namespace Game.Spells
|
||||
if (m_preGeneratedPath.GetPathType() == PathType.Blank)
|
||||
{
|
||||
Position pos = unitTarget.GetFirstCollisionPosition(unitTarget.GetObjectSize(), unitTarget.GetRelativeAngle(m_caster.GetPosition()));
|
||||
if (m_spellInfo.HasAttribute(SpellAttr9.SpecialDelayCalculation))
|
||||
if (MathFunctions.fuzzyGt(m_spellInfo.Speed, 0.0f) && m_spellInfo.HasAttribute(SpellAttr9.SpecialDelayCalculation))
|
||||
speed = pos.GetExactDist(m_caster) / speed;
|
||||
|
||||
m_caster.GetMotionMaster().MoveCharge(pos.posX, pos.posY, pos.posZ, speed, EventId.Charge, false, unitTarget, spellEffectExtraData);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_spellInfo.HasAttribute(SpellAttr9.SpecialDelayCalculation))
|
||||
if (MathFunctions.fuzzyGt(m_spellInfo.Speed, 0.0f) && m_spellInfo.HasAttribute(SpellAttr9.SpecialDelayCalculation))
|
||||
{
|
||||
Vector3 pos = m_preGeneratedPath.GetActualEndPosition();
|
||||
speed = new Position(pos.X, pos.Y, pos.Z).GetExactDist(m_caster) / speed;
|
||||
|
||||
Reference in New Issue
Block a user