mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
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);
|
||||||
|
|||||||
@@ -1500,12 +1500,13 @@ public:
|
|||||||
[[nodiscard]] uint32 HasUnitTypeMask(uint32 mask) const { return mask & m_unitTypeMask; }
|
[[nodiscard]] uint32 HasUnitTypeMask(uint32 mask) const { return mask & m_unitTypeMask; }
|
||||||
void AddUnitTypeMask(uint32 mask) { m_unitTypeMask |= mask; }
|
void AddUnitTypeMask(uint32 mask) { m_unitTypeMask |= mask; }
|
||||||
[[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 IsPet() const { return m_unitTypeMask & UNIT_MASK_PET; }
|
[[nodiscard]] bool IsControllableGuardian() const { return m_unitTypeMask & UNIT_MASK_CONTROLABLE_GUARDIAN; }
|
||||||
|
[[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; }
|
||||||
[[nodiscard]] bool IsVehicle() const { return m_unitTypeMask & UNIT_MASK_VEHICLE; }
|
[[nodiscard]] bool IsVehicle() const { return m_unitTypeMask & UNIT_MASK_VEHICLE; }
|
||||||
|
|
||||||
[[nodiscard]] uint8 getLevel() const { return uint8(GetUInt32Value(UNIT_FIELD_LEVEL)); }
|
[[nodiscard]] uint8 getLevel() const { return uint8(GetUInt32Value(UNIT_FIELD_LEVEL)); }
|
||||||
uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return getLevel(); }
|
uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return getLevel(); }
|
||||||
|
|||||||
Reference in New Issue
Block a user