Core/Objects: Refactor private object checks into separate function

Port From (https://github.com/TrinityCore/TrinityCore/commit/f21270b987211041b95d6befa7192d313692920d)
This commit is contained in:
hondacrx
2021-03-29 17:20:45 -04:00
parent b4bf10ed22
commit 1ca5b5bcad
3 changed files with 22 additions and 6 deletions
+1 -1
View File
@@ -2300,7 +2300,7 @@ namespace Game.Maps
public bool Invoke(Creature u)
{
if (u.GetDeathState() != DeathState.Dead && u.GetEntry() == i_entry && u.IsAlive() == i_alive && i_obj.IsWithinDistInMap(u, i_range) && u.CanSeeOrDetect(i_obj))
if (u.GetDeathState() != DeathState.Dead && u.GetEntry() == i_entry && u.IsAlive() == i_alive && i_obj.IsWithinDistInMap(u, i_range) && u.CheckPrivateObjectOwnerVisibility(i_obj))
{
i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check
return true;