diff --git a/Source/Game/Conditions/Condition.cs b/Source/Game/Conditions/Condition.cs index bebab37c3..38398bee1 100644 --- a/Source/Game/Conditions/Condition.cs +++ b/Source/Game/Conditions/Condition.cs @@ -637,6 +637,7 @@ namespace Game.Conditions case ConditionSourceType.SmartEvent: case ConditionSourceType.NpcVendor: case ConditionSourceType.SpellProc: + case ConditionSourceType.ObjectIdVisibility: return 2; default: return 1; diff --git a/Source/Game/Conditions/ConditionManager.cs b/Source/Game/Conditions/ConditionManager.cs index 7c29540b1..14d5cb71c 100644 --- a/Source/Game/Conditions/ConditionManager.cs +++ b/Source/Game/Conditions/ConditionManager.cs @@ -312,13 +312,13 @@ namespace Game return true; } - public bool IsObjectMeetingVisibilityByObjectIdConditions(uint objectType, uint entry, WorldObject seer) + public bool IsObjectMeetingVisibilityByObjectIdConditions(WorldObject obj, WorldObject seer) { - var conditions = ConditionStorage[ConditionSourceType.ObjectIdVisibility].LookupByKey(new ConditionId(objectType, (int)entry, 0)); + var conditions = ConditionStorage[ConditionSourceType.ObjectIdVisibility].LookupByKey(new ConditionId((uint)obj.GetTypeId(), (int)obj.GetEntry(), 0)); if (conditions != null) { - Log.outDebug(LogFilter.Condition, $"IsObjectMeetingVisibilityByObjectIdConditions: found conditions for objectType {objectType} entry {entry}"); - return IsObjectMeetToConditions(seer, conditions); + Log.outDebug(LogFilter.Condition, $"IsObjectMeetingVisibilityByObjectIdConditions: found conditions for objectType {obj.GetTypeId()} entry {obj.GetEntry()} guid {obj.GetGUID()}"); + return IsObjectMeetToConditions(seer, obj, conditions); } return true; } diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index b1d11b146..7b89f3743 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -1271,7 +1271,7 @@ namespace Game.Entities if (smoothPhasing != null && smoothPhasing.IsBeingReplacedForSeer(GetGUID())) return false; - if (!obj.IsPrivateObject() && !Global.ConditionMgr.IsObjectMeetingVisibilityByObjectIdConditions((uint)obj.GetTypeId(), obj.GetEntry(), this)) + if (!obj.IsPrivateObject() && !Global.ConditionMgr.IsObjectMeetingVisibilityByObjectIdConditions(obj, this)) return false; // Spawn tracking