diff --git a/CustomizePlus.GameData/Extensions/ActorIdentifierExtensions.cs b/CustomizePlus.GameData/Extensions/ActorIdentifierExtensions.cs index 122d125..8e3d834 100644 --- a/CustomizePlus.GameData/Extensions/ActorIdentifierExtensions.cs +++ b/CustomizePlus.GameData/Extensions/ActorIdentifierExtensions.cs @@ -28,6 +28,35 @@ public static class ActorIdentifierExtensions return PenumbraExtensions.Manager.Data.ToName(identifier.Kind, identifier.DataId); } + /// + /// Compares two actor identifiers while ignoring ownership for owned objects. For all other identifier types will use Matches() method. + /// + public static bool CompareIgnoringOwnership(this ActorIdentifier identifier, ActorIdentifier other) + { + if (identifier.Type != other.Type) + return false; + + return identifier.Type switch + { + IdentifierType.Owned => PenumbraExtensions.Manager.DataIdEquals(identifier, other), + _ => identifier.Matches(other) + }; + } + + /// + /// Check if owned actor is owned by local player. Will return false if Type is not Owned. + /// + public static bool IsOwnedByLocalPlayer(this ActorIdentifier identifier) + { + if (identifier.Type != IdentifierType.Owned) + return false; + + if (PenumbraExtensions.Manager == null) + return false; + + return identifier.PlayerName == PenumbraExtensions.Manager.GetCurrentPlayer().PlayerName; + } + /// /// Wrapper around Incognito which returns non-incognito name in debug builds /// diff --git a/CustomizePlus/Api/Data/IPCCharacterProfile.cs b/CustomizePlus/Api/Data/IPCCharacterProfile.cs index c0f75c2..262e8cc 100644 --- a/CustomizePlus/Api/Data/IPCCharacterProfile.cs +++ b/CustomizePlus/Api/Data/IPCCharacterProfile.cs @@ -53,7 +53,6 @@ public class IPCCharacterProfile CreationDate = DateTimeOffset.UtcNow, ModifiedDate = DateTimeOffset.UtcNow, Enabled = true, - LimitLookupToOwnedObjects = false, UniqueId = Guid.NewGuid(), Templates = new List