Core/Creature: Fall back to combat list if calling for help without threat list

Port From (https://github.com/TrinityCore/TrinityCore/commit/6a91fe3fbe28e3bf36ab6107b9c6cbb842f65262)
This commit is contained in:
hondacrx
2021-10-30 20:22:04 -04:00
parent faa2360995
commit 7050fda482
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ namespace Game.Combat
return false;
}
Unit GetAnyTarget()
public Unit GetAnyTarget()
{
if (!_pveRefs.Empty())
return _pveRefs.First().Value.GetOther(_owner);
@@ -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);