mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
fix(Core/Creatures): Critters should start fleeing upon entering comb… (#14253)
This commit is contained in:
@@ -36,6 +36,7 @@ void FleeingMovementGenerator<T>::DoInitialize(T* owner)
|
||||
return;
|
||||
}
|
||||
|
||||
owner->StopMoving();
|
||||
_path = nullptr;
|
||||
owner->SetUnitFlag(UNIT_FLAG_FLEEING);
|
||||
owner->AddUnitState(UNIT_STATE_FLEEING);
|
||||
@@ -233,8 +234,19 @@ void TimedFleeingMovementGenerator::Finalize(Unit* owner)
|
||||
{
|
||||
owner->RemoveUnitFlag(UNIT_FLAG_FLEEING);
|
||||
owner->ClearUnitState(UNIT_STATE_FLEEING | UNIT_STATE_FLEEING_MOVE);
|
||||
if (owner->GetVictim())
|
||||
owner->SetTarget(owner->GetVictim()->GetGUID());
|
||||
|
||||
if (Unit* victim = owner->GetVictim())
|
||||
{
|
||||
owner->SetTarget(victim->GetGUID());
|
||||
}
|
||||
|
||||
if (Creature* ownerCreature = owner->ToCreature())
|
||||
{
|
||||
if (CreatureAI* AI = ownerCreature->AI())
|
||||
{
|
||||
AI->MovementInform(TIMED_FLEEING_MOTION_TYPE, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TimedFleeingMovementGenerator::Update(Unit* owner, uint32 time_diff)
|
||||
|
||||
Reference in New Issue
Block a user