fix(Core/AI): Improve creature leashing behavior. (#19751)
* Init. https: //github.com/vmangos/core/commit/7d2f1e2923734ea1b983eeaa0208cfd158d4af02 Co-Authored-By: ratkosrb <35845488+ratkosrb@users.noreply.github.com> * Hackfix for pets. * Whoops. * Correct evade uses. * Conflict. * Actually fix grace timer. * Add visibility distance check. Creatures should always fail combat checks in the open world if they're outside of visibility distance, might not be the case for worldbosses. --------- Co-authored-by: ratkosrb <35845488+ratkosrb@users.noreply.github.com>
This commit is contained in:
parent
1edac37ac3
commit
bf18b9bdfb
8 changed files with 61 additions and 42 deletions
|
|
@ -148,6 +148,15 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
|||
owner->ClearUnitState(UNIT_STATE_CHASE_MOVE);
|
||||
owner->SetInFront(target);
|
||||
MovementInform(owner);
|
||||
|
||||
// Mobs should chase you infinitely if you stop and wait every few seconds.
|
||||
i_leashExtensionTimer.Update(time_diff);
|
||||
if (i_leashExtensionTimer.Passed())
|
||||
{
|
||||
i_leashExtensionTimer.Reset(5000);
|
||||
if (Creature* creature = owner->ToCreature())
|
||||
creature->UpdateLeashExtensionTime();
|
||||
}
|
||||
}
|
||||
|
||||
// if the target moved, we have to consider whether to adjust
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue