Core/Misc: Added new CanSeeOrDetectExtraArgs to CanSeeOrDetect

Port From (https://github.com/TrinityCore/TrinityCore/commit/260fab23786917619ad3453677ed7d983a431cc4)
This commit is contained in:
Hondacrx
2025-08-14 20:37:45 -04:00
parent 1b838e6d5a
commit 1f80df2465
6 changed files with 70 additions and 29 deletions
+6 -6
View File
@@ -3959,11 +3959,11 @@ namespace Game.Entities
return false;
}
public override bool CanNeverSee(WorldObject obj)
public override bool CanNeverSee(WorldObject obj, bool ignorePhaseShift = false)
{
// the intent is to delay sending visible objects until client is ready for them
// some gameobjects dont function correctly if they are sent before TransportServerTime is correctly set (after CMSG_MOVE_INIT_ACTIVE_MOVER_COMPLETE)
return !HasPlayerLocalFlag(PlayerLocalFlags.OverrideTransportServerTime) || base.CanNeverSee(obj);
return !HasPlayerLocalFlag(PlayerLocalFlags.OverrideTransportServerTime) || base.CanNeverSee(obj, ignorePhaseShift);
}
public override bool CanAlwaysSee(WorldObject obj)
@@ -6229,7 +6229,7 @@ namespace Game.Entities
{
if (HaveAtClient(target))
{
if (!CanSeeOrDetect(target, false, true))
if (!CanSeeOrDetect(target, new CanSeeOrDetectExtraArgs() { DistanceCheck = true }))
{
BeforeVisibilityDestroy(target, this);
@@ -6243,7 +6243,7 @@ namespace Game.Entities
}
else
{
if (CanSeeOrDetect(target, false, true))
if (CanSeeOrDetect(target, new CanSeeOrDetectExtraArgs() { DistanceCheck = true }))
{
target.SendUpdateToPlayer(this);
m_clientGUIDs.Add(target.GetGUID());
@@ -6259,7 +6259,7 @@ namespace Game.Entities
{
if (HaveAtClient(target))
{
if (!CanSeeOrDetect(target, false, true))
if (!CanSeeOrDetect(target, new CanSeeOrDetectExtraArgs() { DistanceCheck = true }))
{
BeforeVisibilityDestroy(target, this);
@@ -6273,7 +6273,7 @@ namespace Game.Entities
}
else
{
if (CanSeeOrDetect(target, false, true))
if (CanSeeOrDetect(target, new CanSeeOrDetectExtraArgs() { DistanceCheck = true }))
{
target.BuildCreateUpdateBlockForPlayer(data, this);
m_clientGUIDs.Add(target.GetGUID());