diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-06-21 15:35:12 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-06-23 23:48:49 +0200 |
commit | bab83b91d92c568b96d624cd048b23e48ae68a18 (patch) | |
tree | 89b6d001ce77cdb8288969db746c6ba57e11651e /src/server/game/Spells/SpellEffects.cpp | |
parent | 59c1beeb4c08cec6bc936148b56a1a30b3b05817 (diff) |
Core/Movement: Allow setting position or object facing targets for jump movement
(cherry picked from commit ac73edc268bc8d5bbda9f4b05168e3e24c25ca45)
# Conflicts:
# src/server/scripts/Kalimdor/RagefireChasm/boss_lava_guard_gordoth.cpp
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 74262ac15c4..69c42a2c13c 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -908,7 +908,7 @@ void Spell::EffectJump() JumpArrivalCastArgs arrivalCast; arrivalCast.SpellId = effectInfo->TriggerSpell; arrivalCast.Target = unitTarget->GetGUID(); - unitCaster->GetMotionMaster()->MoveJump(*unitTarget, speedXY, speedZ, EVENT_JUMP, false, &arrivalCast); + unitCaster->GetMotionMaster()->MoveJump(*unitTarget, speedXY, speedZ, EVENT_JUMP, {}, &arrivalCast); } void Spell::EffectJumpDest() @@ -928,9 +928,12 @@ void Spell::EffectJumpDest() float speedXY, speedZ; CalculateJumpSpeeds(effectInfo, unitCaster->GetExactDist2d(destTarget), speedXY, speedZ); + MovementFacingTarget facing; + if (!m_targets.GetUnitTargetGUID().IsEmpty()) + facing = destTarget->GetOrientation(); JumpArrivalCastArgs arrivalCast; arrivalCast.SpellId = effectInfo->TriggerSpell; - unitCaster->GetMotionMaster()->MoveJump(*destTarget, speedXY, speedZ, EVENT_JUMP, !m_targets.GetObjectTargetGUID().IsEmpty(), &arrivalCast); + unitCaster->GetMotionMaster()->MoveJump(*destTarget, speedXY, speedZ, EVENT_JUMP, facing, &arrivalCast); } TeleportToOptions GetTeleportOptions(WorldObject const* caster, Unit const* unitTarget, SpellDestination const& targetDest) @@ -5751,7 +5754,7 @@ void Spell::EffectJumpCharge() effectExtra->ParabolicCurveId = *params->ParabolicCurveId; } - unitCaster->GetMotionMaster()->MoveJumpWithGravity(*destTarget, speed, params->JumpGravity, EVENT_JUMP, false, + unitCaster->GetMotionMaster()->MoveJumpWithGravity(*destTarget, speed, params->JumpGravity, EVENT_JUMP, {}, arrivalCast ? &*arrivalCast : nullptr, effectExtra ? &*effectExtra : nullptr); } |