From 9b63ee43337a5449d6a74869c8d91dfa8b5211bb Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 22 Aug 2016 21:10:43 +0200 Subject: Core/Creatures: Exclude despawned creatures from being found by "nearest entry" searchers Updates #11418 Closes #17706 (cherry picked from commit 75c34bda679e7307c6e85b7e288b6e72eb14ca38) --- src/server/game/Grids/Notifiers/GridNotifiers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 3ff1ae222af..ce1e81468ab 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1185,7 +1185,7 @@ namespace Trinity bool operator()(Creature* u) { - if (u->GetEntry() == i_entry && u->IsAlive() == i_alive && i_obj.IsWithinDistInMap(u, i_range)) + if (u->getDeathState() != DEAD && u->GetEntry() == i_entry && u->IsAlive() == i_alive && i_obj.IsWithinDistInMap(u, i_range)) { i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check return true; -- cgit v1.2.3