mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-20 23:11:56 -04:00
Core/Unit: Some charm fixes:
* Properly restore react state after possession expires. Closes #20769. * Possessed creatures now don't override player control with random/waypoint motion * SmartAI creatures now properly re-aggress charmer after charm expires
This commit is contained in:
@@ -679,8 +679,13 @@ void SmartAI::OnCharmed(bool /*isNew*/)
|
||||
else
|
||||
me->SetWalk(!mRun);
|
||||
|
||||
if (Unit* charmer = me->GetCharmer())
|
||||
AttackStart(charmer);
|
||||
if (me->LastCharmerGUID)
|
||||
{
|
||||
if (!me->HasReactState(REACT_PASSIVE))
|
||||
if (Unit* lastCharmer = ObjectAccessor::GetUnit(*me, me->LastCharmerGUID))
|
||||
me->EngageWithTarget(lastCharmer);
|
||||
me->LastCharmerGUID.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, nullptr, 0, 0, charmed);
|
||||
|
||||
Reference in New Issue
Block a user