Fix an overly strict check that was causing guardians to evade loop. Also make players properly enter combat when their pets are engaged by a creature.
Port From (https://github.com/TrinityCore/TrinityCore/commit/09027e5ccc9618e5fae45a354bcd01cd04ee0aa1)
This commit is contained in:
@@ -52,7 +52,6 @@ namespace Game.AI
|
|||||||
{
|
{
|
||||||
if (!me.IsAlive())
|
if (!me.IsAlive())
|
||||||
{
|
{
|
||||||
Log.outDebug(LogFilter.Server, "Creature stoped attacking cuz his dead [{0}]", me.GetGUID().ToString());
|
|
||||||
me.GetMotionMaster().Clear();
|
me.GetMotionMaster().Clear();
|
||||||
me.GetMotionMaster().MoveIdle();
|
me.GetMotionMaster().MoveIdle();
|
||||||
me.CombatStop();
|
me.CombatStop();
|
||||||
|
|||||||
@@ -450,6 +450,15 @@ namespace Game.Entities
|
|||||||
if (victim.IsTypeId(TypeId.Player))
|
if (victim.IsTypeId(TypeId.Player))
|
||||||
victim.SetInCombatWith(this);
|
victim.SetInCombatWith(this);
|
||||||
|
|
||||||
|
Unit owner = victim.GetOwner();
|
||||||
|
if (owner != null)
|
||||||
|
{
|
||||||
|
AddThreat(owner, 0.0f);
|
||||||
|
SetInCombatWith(owner);
|
||||||
|
if (owner.GetTypeId() == TypeId.Player)
|
||||||
|
owner.SetInCombatWith(this);
|
||||||
|
}
|
||||||
|
|
||||||
creature.SendAIReaction(AiReaction.Hostile);
|
creature.SendAIReaction(AiReaction.Hostile);
|
||||||
creature.CallAssistance();
|
creature.CallAssistance();
|
||||||
|
|
||||||
@@ -546,7 +555,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
Unit victim = GetVictim();
|
Unit victim = GetVictim();
|
||||||
if (victim != null)
|
if (victim != null)
|
||||||
if (!IsControlledByPlayer() || IsInCombatWith(victim) || victim.IsInCombatWith(this))
|
if ((!IsPet() && GetPlayerMovingMe() == null) || IsInCombatWith(victim) || victim.IsInCombatWith(this))
|
||||||
return victim;
|
return victim;
|
||||||
|
|
||||||
if (!attackerList.Empty())
|
if (!attackerList.Empty())
|
||||||
|
|||||||
Reference in New Issue
Block a user