mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-02 10:33:46 +00:00
Fix Evading issue
This commit is contained in:
@@ -3494,26 +3494,35 @@ bool Creature::IsMovementPreventedByCasting() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Creature::SetCannotReachTarget()
|
||||
void Creature::SetCannotReachTarget(ObjectGuid const& cannotReach)
|
||||
{
|
||||
return SetCannotReachTarget(true);
|
||||
}
|
||||
|
||||
bool Creature::SetCannotReachTarget(bool cannotReach, bool isChase /*= true*/)
|
||||
if (cannotReach == m_cannotReachTarget)
|
||||
{
|
||||
if (!isChase || !Unit::SetCannotReachTarget(cannotReach))
|
||||
{
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
m_cannotReachTarget = cannotReach;
|
||||
m_cannotReachTimer = 0;
|
||||
|
||||
if (cannotReach)
|
||||
{
|
||||
LOG_DEBUG("entities.unit", "Creature::SetCannotReachTarget() called with true. Details: {}", GetDebugInfo());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
bool Creature::CanNotReachTarget() const
|
||||
{
|
||||
return m_cannotReachTarget;
|
||||
}
|
||||
|
||||
bool Creature::IsNotReachableAndNeedRegen() const
|
||||
{
|
||||
if (CanNotReachTarget())
|
||||
{
|
||||
return m_cannotReachTimer >= (sWorld->getIntConfig(CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID) * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
time_t Creature::GetLastDamagedTime() const
|
||||
|
||||
@@ -310,10 +310,9 @@ public:
|
||||
return m_charmInfo->GetCharmSpell(pos)->GetAction();
|
||||
}
|
||||
|
||||
bool SetCannotReachTarget();
|
||||
bool SetCannotReachTarget(bool cannotReach, bool isChase = true) override;
|
||||
[[nodiscard]] bool IsNotReachable() const { return (m_cannotReachTimer >= (sWorld->getIntConfig(CONFIG_NPC_EVADE_IF_NOT_REACHABLE) * IN_MILLISECONDS)) && m_cannotReachTarget; }
|
||||
[[nodiscard]] bool IsNotReachableAndNeedRegen() const { return (m_cannotReachTimer >= (sWorld->getIntConfig(CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID) * IN_MILLISECONDS)) && m_cannotReachTarget; }
|
||||
void SetCannotReachTarget(ObjectGuid const& target = ObjectGuid::Empty);
|
||||
[[nodiscard]] bool CanNotReachTarget() const;
|
||||
[[nodiscard]] bool IsNotReachableAndNeedRegen() const;
|
||||
|
||||
void SetPosition(float x, float y, float z, float o);
|
||||
void SetPosition(const Position& pos) { SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); }
|
||||
|
||||
Reference in New Issue
Block a user