diff --git a/Penumbra.Api b/Penumbra.Api index f66e49bd..d87dfa44 160000 --- a/Penumbra.Api +++ b/Penumbra.Api @@ -1 +1 @@ -Subproject commit f66e49bde2878542de17edf428de61f6c8a42efc +Subproject commit d87dfa44ff6efcf4fe576d8a877c78f4ac0dc893 diff --git a/Penumbra/Api/PenumbraApi.cs b/Penumbra/Api/PenumbraApi.cs index da560ca9..fba7cecb 100644 --- a/Penumbra/Api/PenumbraApi.cs +++ b/Penumbra/Api/PenumbraApi.cs @@ -905,8 +905,14 @@ public class PenumbraApi : IDisposable, IPenumbraApi return PenumbraApiEc.CollectionMissing; } - if( !forceAssignment - && ( Penumbra.TempMods.Collections.Individuals.ContainsKey( identifier ) || Penumbra.CollectionManager.Individuals.Individuals.ContainsKey( identifier ) ) ) + if( forceAssignment ) + { + if( Penumbra.TempMods.Collections.Individuals.ContainsKey( identifier ) && !Penumbra.TempMods.Collections.Delete( identifier ) ) + { + return PenumbraApiEc.AssignmentDeletionFailed; + } + } + else if( Penumbra.TempMods.Collections.Individuals.ContainsKey( identifier ) || Penumbra.CollectionManager.Individuals.Individuals.ContainsKey( identifier ) ) { return PenumbraApiEc.CharacterCollectionExists; } diff --git a/Penumbra/Api/TempModManager.cs b/Penumbra/Api/TempModManager.cs index 08393ebd..1034ca0d 100644 --- a/Penumbra/Api/TempModManager.cs +++ b/Penumbra/Api/TempModManager.cs @@ -187,7 +187,7 @@ public class TempModManager if( Collections[ i ].Collection == collection ) { CollectionChanged?.Invoke( CollectionType.Temporary, collection, null, Collections[ i ].DisplayName ); - Collections.Delete( i ); + Collections.Delete( i-- ); } }