From b0ac02546a6fb491cb0601d1e6aba1713989ab10 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 24 May 2022 10:13:19 -0400 Subject: [PATCH] Core/Creature: Ignore combat reach when looking for assisting creatures Port From (https://github.com/TrinityCore/TrinityCore/commit/df94ce0f6853e62b9eb591cba38fa36917314c6d) --- Source/Game/Maps/GridNotifiers.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Game/Maps/GridNotifiers.cs b/Source/Game/Maps/GridNotifiers.cs index 097ea5f79..31a58da8b 100644 --- a/Source/Game/Maps/GridNotifiers.cs +++ b/Source/Game/Maps/GridNotifiers.cs @@ -924,7 +924,8 @@ namespace Game.Maps return; // too far - if (!u.IsWithinDistInMap(i_funit, i_range)) + // Don't use combat reach distance, range must be an absolute value, otherwise the chain aggro range will be too big + if (!u.IsWithinDistInMap(i_funit, i_range, true, false, false)) return; // only if see assisted creature's enemy @@ -2321,7 +2322,8 @@ namespace Game.Maps return false; // too far - if (!i_funit.IsWithinDistInMap(u, i_range)) + // Don't use combat reach distance, range must be an absolute value, otherwise the chain aggro range will be too big + if (!i_funit.IsWithinDistInMap(u, i_range, true, false, false)) return false; // only if see assisted creature @@ -2349,10 +2351,12 @@ namespace Game.Maps { if (u == i_obj) return false; + if (!u.CanAssistTo(i_obj, i_enemy)) return false; - if (!i_obj.IsWithinDistInMap(u, i_range)) + // Don't use combat reach distance, range must be an absolute value, otherwise the chain aggro range will be too big + if (!i_obj.IsWithinDistInMap(u, i_range, true, false, false)) return false; if (!i_obj.IsWithinLOSInMap(u))