diff options
author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2020-01-01 16:28:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-01 16:28:33 +0100 |
commit | 4ccf01de3947f50629c20192da3f99cb8c693b35 (patch) | |
tree | 4414d89234ddfb50e396224c29a42768ae433778 /src/server/game/Movement/MotionMaster.cpp | |
parent | 7fb74326205acbc5c0fa6b2aa9731d891e788d64 (diff) |
Fix fleeing speed to 66% run speed (#24025)
* Core/Movement: Fix fleeing speed to 66% run speed
Fix fleeing speed to 66% run speed until the creature starts returning home
* Fix build
* Don't check speed type
* Don't apply speed reduction twice
* Fix no-pch (1st try)
* Make sure every spell focus is interrupted when seeking assistance
Diffstat (limited to 'src/server/game/Movement/MotionMaster.cpp')
-rw-r--r-- | src/server/game/Movement/MotionMaster.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 56934f67c7c..32d0661020c 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -929,13 +929,14 @@ void MotionMaster::MoveFall(uint32 id/* = 0*/) void MotionMaster::MoveSeekAssistance(float x, float y, float z) { - if (_owner->GetTypeId() == TYPEID_UNIT) + if (Creature* creature = _owner->ToCreature()) { - TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveSeekAssistance: '%s', seeks assistance (X: %f, Y: %f, Z: %f)", _owner->GetGUID().ToString().c_str(), x, y, z); - _owner->AttackStop(); - _owner->CastStop(); - _owner->ToCreature()->SetReactState(REACT_PASSIVE); - Add(new AssistanceMovementGenerator(EVENT_ASSIST_MOVE, x, y, z, _owner->GetSpeed(MOVE_RUN) * 0.66f)); + TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveSeekAssistance: '%s', seeks assistance (X: %f, Y: %f, Z: %f)", creature->GetGUID().ToString().c_str(), x, y, z); + creature->AttackStop(); + creature->CastStop(); + creature->DoNotReacquireSpellFocusTarget(); + creature->SetReactState(REACT_PASSIVE); + Add(new AssistanceMovementGenerator(EVENT_ASSIST_MOVE, x, y, z)); } else TC_LOG_ERROR("movement.motionmaster", "MotionMaster::MoveSeekAssistance: '%s', attempted to seek assistance.", _owner->GetGUID().ToString().c_str()); |