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

This commit is contained in:
Treeston
2019-08-02 21:26:32 +02:00
committed by Ovahlord
parent d2df9bdf15
commit f41cfa9185
2 changed files with 9 additions and 2 deletions

View File

@@ -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);

View File

@@ -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;
}