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:
@@ -88,7 +88,7 @@ namespace Game.Combat
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit GetAnyTarget()
|
public Unit GetAnyTarget()
|
||||||
{
|
{
|
||||||
if (!_pveRefs.Empty())
|
if (!_pveRefs.Empty())
|
||||||
return _pveRefs.First().Value.GetOther(_owner);
|
return _pveRefs.First().Value.GetOther(_owner);
|
||||||
|
|||||||
@@ -2182,6 +2182,8 @@ namespace Game.Entities
|
|||||||
Unit target = GetThreatManager().GetCurrentVictim();
|
Unit target = GetThreatManager().GetCurrentVictim();
|
||||||
if (target == null)
|
if (target == null)
|
||||||
target = GetThreatManager().GetAnyTarget();
|
target = GetThreatManager().GetAnyTarget();
|
||||||
|
if (target == null)
|
||||||
|
target = GetCombatManager().GetAnyTarget();
|
||||||
Cypher.Assert(target != null, $"Creature {GetEntry()} ({GetName()}) is engaged without threat list");
|
Cypher.Assert(target != null, $"Creature {GetEntry()} ({GetName()}) is engaged without threat list");
|
||||||
|
|
||||||
var u_do = new CallOfHelpCreatureInRangeDo(this, target, radius);
|
var u_do = new CallOfHelpCreatureInRangeDo(this, target, radius);
|
||||||
|
|||||||
Reference in New Issue
Block a user