Core/Entities: Kick engagement logic upstairs to Unit (from ThreatManager), since all Units with AI need it (not just those with threat list).

Port From (https://github.com/TrinityCore/TrinityCore/commit/35e55f10899712435102764671241b94a2026599)
This commit is contained in:
hondacrx
2021-12-23 20:00:45 -05:00
parent ff48f2cab9
commit 8694a2ae24
6 changed files with 49 additions and 42 deletions
+5 -3
View File
@@ -934,7 +934,7 @@ namespace Game.Chat
{
if (!mgr.IsThreatListEmpty(true))
{
if (mgr.IsEngaged())
if (target.IsEngaged())
handler.SendSysMessage($"Threat list of {target.GetName()} ({target.GetGUID()}, SpawnID {(target.IsCreature() ? target.ToCreature().GetSpawnId() : 0)}):");
else
handler.SendSysMessage($"{target.GetName()} ({target.GetGUID()}, SpawnID {(target.IsCreature() ? target.ToCreature().GetSpawnId() : 0)}) is not engaged, but still has a threat list? Well, here it is:");
@@ -948,13 +948,15 @@ namespace Game.Chat
}
handler.SendSysMessage("End of threat list.");
}
else if (!mgr.IsEngaged())
else if (!target.IsEngaged())
handler.SendSysMessage($"{target.GetName()} ({target.GetGUID()}, SpawnID {(target.IsCreature() ? target.ToCreature().GetSpawnId() : 0)}) is not currently engaged.");
else
handler.SendSysMessage($"{target.GetName()} ({target.GetGUID()}, SpawnID {(target.IsCreature() ? target.ToCreature().GetSpawnId() : 0)}) seems to be engaged, but does not have a threat list??");
}
else if (target.IsEngaged())
handler.SendSysMessage($"{target.GetName()} ({target.GetGUID()}) is currently engaged. (This unit cannot have a threat list.)");
else
handler.SendSysMessage($"{target.GetName()} ({target.GetGUID()}) cannot have a threat list.");
handler.SendSysMessage($"{target.GetName()} ({target.GetGUID()}) is not currently engaged. (This unit cannot have a threat list.)");
return true;
}