mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-31 06:07:37 +01:00
Core/SmartAI: SmartAI creatures no longer process health-based hooks after death.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user