fix(Core/Unit): Make players turn to their target during charm automatically (#23534)
This commit is contained in:
@@ -1968,10 +1968,7 @@ void Player::UpdateCharmedAI()
|
|||||||
|
|
||||||
Unit* target = GetVictim();
|
Unit* target = GetVictim();
|
||||||
if (target)
|
if (target)
|
||||||
{
|
|
||||||
SetInFront(target);
|
SetInFront(target);
|
||||||
SendMovementFlagUpdate(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (HasUnitState(UNIT_STATE_CASTING))
|
if (HasUnitState(UNIT_STATE_CASTING))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -10963,7 +10963,11 @@ void Unit::SetCharm(Unit* charm, bool apply)
|
|||||||
charm->SetUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
|
charm->SetUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
charm->m_ControlledByPlayer = false;
|
charm->m_ControlledByPlayer = false;
|
||||||
|
if (!HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
|
||||||
|
charm->RemoveUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
|
||||||
|
}
|
||||||
|
|
||||||
// PvP, FFAPvP
|
// PvP, FFAPvP
|
||||||
charm->SetByteValue(UNIT_FIELD_BYTES_2, 1, GetByteValue(UNIT_FIELD_BYTES_2, 1));
|
charm->SetByteValue(UNIT_FIELD_BYTES_2, 1, GetByteValue(UNIT_FIELD_BYTES_2, 1));
|
||||||
|
|||||||
Reference in New Issue
Block a user