From 7050fda482b131573bdfbb6e324b6dc810bb89c8 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 30 Oct 2021 20:22:04 -0400 Subject: [PATCH] Core/Creature: Fall back to combat list if calling for help without threat list Port From (https://github.com/TrinityCore/TrinityCore/commit/6a91fe3fbe28e3bf36ab6107b9c6cbb842f65262) --- Source/Game/Combat/CombatManager.cs | 2 +- Source/Game/Entities/Creature/Creature.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Game/Combat/CombatManager.cs b/Source/Game/Combat/CombatManager.cs index d4385ae6f..083a20730 100644 --- a/Source/Game/Combat/CombatManager.cs +++ b/Source/Game/Combat/CombatManager.cs @@ -88,7 +88,7 @@ namespace Game.Combat return false; } - Unit GetAnyTarget() + public Unit GetAnyTarget() { if (!_pveRefs.Empty()) return _pveRefs.First().Value.GetOther(_owner); diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 33a536ddd..8cdbb02d1 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -2182,6 +2182,8 @@ namespace Game.Entities Unit target = GetThreatManager().GetCurrentVictim(); if (target == null) target = GetThreatManager().GetAnyTarget(); + if (target == null) + target = GetCombatManager().GetAnyTarget(); Cypher.Assert(target != null, $"Creature {GetEntry()} ({GetName()}) is engaged without threat list"); var u_do = new CallOfHelpCreatureInRangeDo(this, target, radius);