fix(Core/Pets): controllable guardians (including pets) should not set the combat with its target when commanded to attack it (#7315)
- Closes #7264
This commit is contained in:
@@ -9862,7 +9862,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
|
|||||||
//if (GetTypeId() == TYPEID_UNIT)
|
//if (GetTypeId() == TYPEID_UNIT)
|
||||||
// ToCreature()->SetCombatStartPosition(GetPositionX(), GetPositionY(), GetPositionZ());
|
// ToCreature()->SetCombatStartPosition(GetPositionX(), GetPositionY(), GetPositionZ());
|
||||||
|
|
||||||
if (creature && !IsPet())
|
if (creature && !IsControllableGuardian())
|
||||||
{
|
{
|
||||||
// should not let player enter combat by right clicking target - doesn't helps
|
// should not let player enter combat by right clicking target - doesn't helps
|
||||||
SetInCombatWith(victim);
|
SetInCombatWith(victim);
|
||||||
|
|||||||
@@ -1502,6 +1502,7 @@ public:
|
|||||||
[[nodiscard]] uint32 GetUnitTypeMask() const { return m_unitTypeMask; }
|
[[nodiscard]] uint32 GetUnitTypeMask() const { return m_unitTypeMask; }
|
||||||
[[nodiscard]] bool IsSummon() const { return m_unitTypeMask & UNIT_MASK_SUMMON; }
|
[[nodiscard]] bool IsSummon() const { return m_unitTypeMask & UNIT_MASK_SUMMON; }
|
||||||
[[nodiscard]] bool IsGuardian() const { return m_unitTypeMask & UNIT_MASK_GUARDIAN; }
|
[[nodiscard]] bool IsGuardian() const { return m_unitTypeMask & UNIT_MASK_GUARDIAN; }
|
||||||
|
[[nodiscard]] bool IsControllableGuardian() const { return m_unitTypeMask & UNIT_MASK_CONTROLABLE_GUARDIAN; }
|
||||||
[[nodiscard]] bool IsPet() const { return m_unitTypeMask & UNIT_MASK_PET; }
|
[[nodiscard]] bool IsPet() const { return m_unitTypeMask & UNIT_MASK_PET; }
|
||||||
[[nodiscard]] bool IsHunterPet() const { return m_unitTypeMask & UNIT_MASK_HUNTER_PET; }
|
[[nodiscard]] bool IsHunterPet() const { return m_unitTypeMask & UNIT_MASK_HUNTER_PET; }
|
||||||
[[nodiscard]] bool IsTotem() const { return m_unitTypeMask & UNIT_MASK_TOTEM; }
|
[[nodiscard]] bool IsTotem() const { return m_unitTypeMask & UNIT_MASK_TOTEM; }
|
||||||
|
|||||||
Reference in New Issue
Block a user