Fix Evading issue

This commit is contained in:
郑佩茹
2022-08-18 13:46:22 -06:00
parent 32c6babdb7
commit bbd283598d
6 changed files with 47 additions and 38 deletions

View File

@@ -212,7 +212,6 @@ Unit::Unit(bool isWorldObject) : WorldObject(isWorldObject),
m_vehicleKit(nullptr),
m_unitTypeMask(UNIT_MASK_NONE),
m_HostileRefMgr(this),
m_cannotReachTarget(false),
m_comboTarget(nullptr),
m_comboPoints(0)
{
@@ -20787,18 +20786,6 @@ bool Unit::CanRestoreMana(SpellInfo const* spellInfo) const
return false;
}
bool Unit::SetCannotReachTarget(bool cannotReach, bool /*isChase = true*/)
{
if (cannotReach == m_cannotReachTarget)
{
return false;
}
m_cannotReachTarget = cannotReach;
return true;
}
bool Unit::IsInDisallowedMountForm() const
{
if (SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(getTransForm()))
@@ -20864,3 +20851,18 @@ std::string Unit::GetDebugInfo() const
<< " Class: " << std::to_string(getClass());
return sstr.str();
}
void Unit::SetCannotReachTargetUnit(bool cannotReach, bool isChase)
{
if (cannotReach == m_cannotReachTarget)
{
return;
}
m_cannotReachTarget = cannotReach;
}
bool Unit::CanNotReachTarget() const
{
return m_cannotReachTarget;
}

View File

@@ -2428,10 +2428,11 @@ public:
[[nodiscard]] bool CanRestoreMana(SpellInfo const* spellInfo) const;
virtual bool SetCannotReachTarget(bool cannotReach, bool isChase = true);
[[nodiscard]] bool CanNotReachTarget() const { return m_cannotReachTarget; }
std::string GetDebugInfo() const override;
void SetCannotReachTargetUnit(bool target, bool isChase);
[[nodiscard]] bool CanNotReachTarget() const;
bool m_cannotReachTarget;
protected:
explicit Unit (bool isWorldObject);
@@ -2513,8 +2514,6 @@ protected:
bool IsAlwaysDetectableFor(WorldObject const* seer) const override;
bool _instantCast;
bool m_cannotReachTarget;
private:
bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent, ProcEventInfo const& eventInfo);
bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, Spell const* spellProc = nullptr);