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

Port From (https://github.com/TrinityCore/TrinityCore/commit/3db58c4d96c446b736b84d4954f8fd9c9e309e33)
This commit is contained in:
hondacrx
2022-01-02 19:15:03 -05:00
parent 81ab3b4080
commit e70e2d0088
2 changed files with 9 additions and 2 deletions
+7
View File
@@ -322,6 +322,13 @@ namespace Game.AI
public override void UpdateAI(uint diff)
{
if (!me.IsAlive())
{
if (IsEngaged())
EngagementOver();
return;
}
CheckConditions(diff);
GetScript().OnUpdate(diff);
+2 -2
View File
@@ -2176,7 +2176,7 @@ namespace Game.Entities
public void CallForHelp(float radius)
{
if (radius <= 0.0f || !IsEngaged() || IsPet() || IsCharmed())
if (radius <= 0.0f || !IsEngaged() || !IsAlive() || IsPet() || IsCharmed())
return;
Unit target = GetThreatManager().GetCurrentVictim();
@@ -2187,7 +2187,7 @@ namespace Game.Entities
if (target == null)
{
Log.outError(LogFilter.Unit, $"Creature {GetEntry()} ({GetName()}) is engaged without threat list");
Log.outError(LogFilter.Unit, $"Creature {GetEntry()} ({GetName()}) trying to call for help without being in combat.");
return;
}