mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Creatures: Exclude despawned creatures from being found by "nearest entry" searchers
Updates #11418
Closes #17706
(cherry picked from commit 75c34bda67)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user