diff options
| author | NoName <322016+Faq@users.noreply.github.com> | 2020-03-01 21:15:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-01 20:15:54 +0100 |
| commit | 6067a996324dc4e36a414257e6abf7f9dfdfa934 (patch) | |
| tree | a8329e4671c2adc74c94e4c6ac54904d910db7fa /src/server/game/Entities/Unit | |
| parent | 9ba4694ff29a9b782625fb88a528675f2d6a115c (diff) | |
Core/Spell: Proper SPELL_EFFECT_PULL_TOWARDS_DEST implementation for players (#24178)
* Core/Spell: Proper SPELL_EFFECT_PULL_TOWARDS_DEST implementation for players
Closes ##23203 and also reverts 9a1282a
thnx to xvwyh
* Make it optional
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 5 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 0089a3f8801..7518977c4e1 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12313,9 +12313,12 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const return modelid; } -void Unit::JumpTo(float speedXY, float speedZ, bool forward) +void Unit::JumpTo(float speedXY, float speedZ, bool forward, Optional<Position> dest) { float angle = forward ? 0 : float(M_PI); + if (dest) + angle += GetRelativeAngle(*dest); + if (GetTypeId() == TYPEID_UNIT) GetMotionMaster()->MoveJumpTo(angle, speedXY, speedZ); else diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 0ba397f4551..118bab0931c 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1108,7 +1108,7 @@ class TC_GAME_API Unit : public WorldObject void UpdateHeight(float newZ); void KnockbackFrom(float x, float y, float speedXY, float speedZ); - void JumpTo(float speedXY, float speedZ, bool forward = true); + void JumpTo(float speedXY, float speedZ, bool forward = true, Optional<Position> dest = {}); void JumpTo(WorldObject* obj, float speedZ, bool withOrientation = false); void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath = false, bool forceDestination = false); |
