Core/Movement: interrupt a creature's current cast when fleeing for assistance, and (if spell is not castable while moving) when running random/fleeing movement generators. (#17271)

Also make sure the creature is alive before updating.

Fixes #12823.
This commit is contained in:
SnapperRy
2016-06-10 21:03:30 +02:00
committed by Aokromes
parent b917eb955f
commit f7ac30867f
3 changed files with 16 additions and 0 deletions

View File

@@ -531,6 +531,7 @@ void MotionMaster::MoveSeekAssistance(float x, float y, float z)
TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)",
_owner->GetEntry(), _owner->GetGUID().GetCounter(), x, y, z);
_owner->AttackStop();
_owner->CastStop();
_owner->ToCreature()->SetReactState(REACT_PASSIVE);
Mutate(new AssistanceMovementGenerator(x, y, z), MOTION_SLOT_ACTIVE);
}