From 4f669879656a5b0f6afbf7afb338e3050b2854fe Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 1 Sep 2019 10:52:52 -0400 Subject: [PATCH] Core/Creature: redo some logical checks in _IsTargetAcceptable Port From (https://github.com/TrinityCore/TrinityCore/commit/3d52ba93fc59070ef0a8c3411440ad979399c954) --- Source/Game/Entities/Creature/Creature.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 9195d0aed..c90b8113e 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -2035,9 +2035,14 @@ namespace Game.Entities Unit targetVictim = target.getAttackerForHelper(); // if I'm already fighting target, or I'm hostile towards the target, the target is acceptable - if (myVictim == target || targetVictim == this || IsHostileTo(target)) + if (GetVictim() == target || IsHostileTo(target)) return true; + // a player is targeting me, but I'm not hostile towards it, and not currently attacking it, the target is not acceptable + // (players may set their victim from a distance, and doesn't mean we should attack) + if (target.GetTypeId() == TypeId.Player && targetVictim == this) + return false; + // if the target's victim is friendly, and the target is neutral, the target is acceptable if (targetVictim != null && IsFriendlyTo(targetVictim)) return true;