From 27787b5ff4ecdab3e2dd126e6f556cc26a781060 Mon Sep 17 00:00:00 2001 From: hater Date: Thu, 22 Feb 2024 15:33:00 -0500 Subject: [PATCH] fix min range check --- src/server/game/Entities/Unit/Unit.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 53f87f9ca99d55..f8b51eab525e70 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11955,6 +11955,11 @@ float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spell return spellInfo->GetMinRange(); } + if (!target) + { + return spellInfo->GetMinRange(true); + } + return spellInfo->GetMinRange(!IsHostileTo(target)); }