mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
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();
|
||||
if (target)
|
||||
{
|
||||
SetInFront(target);
|
||||
SendMovementFlagUpdate(true);
|
||||
}
|
||||
|
||||
if (HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
@@ -10963,7 +10963,11 @@ void Unit::SetCharm(Unit* charm, bool apply)
|
||||
charm->SetUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
|
||||
}
|
||||
else
|
||||
{
|
||||
charm->m_ControlledByPlayer = false;
|
||||
if (!HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
|
||||
charm->RemoveUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
|
||||
}
|
||||
|
||||
// PvP, FFAPvP
|
||||
charm->SetByteValue(UNIT_FIELD_BYTES_2, 1, GetByteValue(UNIT_FIELD_BYTES_2, 1));
|
||||
|
||||
Reference in New Issue
Block a user