Core/SmartAI: SmartAI creatures no longer process health-based hooks after death.

This commit is contained in:
Treeston authored and Ovahlord committed 2020-07-22 19:21:21 +02:00
1 parent d2df9bdf15
commit f41cfa9185
2 files changed
+9 -2

No files matched your search

@@ -343,6 +343,13 @@ void SmartAI::UpdatePath(uint32 diff)
void SmartAI::UpdateAI(uint32 diff)
{
if (!me->IsAlive())
{
if (IsEngaged())
EngagementOver();
return;
}
CheckConditions(diff);
GetScript()->OnUpdate(diff);
UpdatePath(diff);
@@ -2330,7 +2330,7 @@ void Creature::CallAssistance()
void Creature::CallForHelp(float radius)
{
if (radius <= 0.0f || !IsEngaged() || IsPet() || IsCharmed())
if (radius <= 0.0f || !IsEngaged() || !IsAlive() || IsPet() || IsCharmed())
return;
Unit* target = GetThreatManager().GetCurrentVictim();
@@ -2341,7 +2341,7 @@ void Creature::CallForHelp(float radius)
if (!target)
{
TC_LOG_ERROR("entities.unit", "Creature %u (%s) is engaged without threat list", GetEntry(), GetName().c_str());
TC_LOG_ERROR("entities.unit", "Creature %u (%s) trying to call for help without being in combat.", GetEntry(), GetName().c_str());
return;
}