Update to work with latest AzerothCore master

This commit is contained in:
郑佩茹
2022-07-27 10:15:08 -06:00
parent a5f1fc38a8
commit 29e14042e7
3 changed files with 7 additions and 16 deletions

View File

@@ -307,7 +307,7 @@ bool CreatureAI::_EnterEvadeMode(EvadeReason /*why*/)
me->SetLootRecipient(nullptr);
me->ResetPlayerDamageReq();
me->SetLastDamagedTime(0);
me->SetCannotReachTarget();
me->SetCannotReachTarget(true);
if (ZoneScript* zoneScript = me->GetZoneScript() ? me->GetZoneScript() : (ZoneScript*)me->GetInstanceScript())
zoneScript->OnCreatureEvade(me);

View File

@@ -3494,6 +3494,11 @@ bool Creature::IsMovementPreventedByCasting() const
return false;
}
bool Creature::SetCannotReachTarget()
{
return SetCannotReachTarget(true);
}
bool Creature::SetCannotReachTarget(bool cannotReach, bool isChase /*= true*/)
{
if (!isChase || !Unit::SetCannotReachTarget(cannotReach))
@@ -3511,21 +3516,6 @@ bool Creature::SetCannotReachTarget(bool cannotReach, bool isChase /*= true*/)
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
{
if (!_lastDamagedTime)

View File

@@ -310,6 +310,7 @@ 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; }