From 23919d80833fc62ec25711d3b051dd1448e6f8fa Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Tue, 17 Jan 2023 13:19:05 +0100 Subject: [PATCH] Ensure permanent identifiers. --- Penumbra.GameData/Actors/ActorIdentifier.cs | 2 +- Penumbra/Collections/IndividualCollections.cs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Penumbra.GameData/Actors/ActorIdentifier.cs b/Penumbra.GameData/Actors/ActorIdentifier.cs index f00ad8f6..26565dea 100644 --- a/Penumbra.GameData/Actors/ActorIdentifier.cs +++ b/Penumbra.GameData/Actors/ActorIdentifier.cs @@ -25,7 +25,7 @@ public readonly struct ActorIdentifier : IEquatable // @formatter:on public ActorIdentifier CreatePermanent() - => new(Type, Kind, Index, DataId, PlayerName.IsEmpty ? PlayerName : PlayerName.Clone()); + => new(Type, Kind, Index, DataId, PlayerName.IsEmpty || PlayerName.IsOwned ? PlayerName : PlayerName.Clone()); public bool Equals(ActorIdentifier other) { diff --git a/Penumbra/Collections/IndividualCollections.cs b/Penumbra/Collections/IndividualCollections.cs index 3d5f3fdd..bca5b4a2 100644 --- a/Penumbra/Collections/IndividualCollections.cs +++ b/Penumbra/Collections/IndividualCollections.cs @@ -145,12 +145,14 @@ public sealed partial class IndividualCollections return false; } - _assignments.Add( ( displayName, identifiers, collection ) ); - foreach( var identifier in identifiers ) + for( var i = 0; i < identifiers.Length; ++i ) { - _individuals.Add( identifier, collection ); + identifiers[ i ] = identifiers[ i ].CreatePermanent(); + _individuals.Add( identifiers[ i ], collection ); } + _assignments.Add( ( displayName, identifiers, collection ) ); + return true; }