mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Add correct handling of forceAssignment and correct iteration while deleting.
This commit is contained in:
parent
3c564add0e
commit
831990949f
3 changed files with 10 additions and 4 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit f66e49bde2878542de17edf428de61f6c8a42efc
|
Subproject commit d87dfa44ff6efcf4fe576d8a877c78f4ac0dc893
|
||||||
|
|
@ -905,8 +905,14 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
return PenumbraApiEc.CollectionMissing;
|
return PenumbraApiEc.CollectionMissing;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !forceAssignment
|
if( forceAssignment )
|
||||||
&& ( Penumbra.TempMods.Collections.Individuals.ContainsKey( identifier ) || Penumbra.CollectionManager.Individuals.Individuals.ContainsKey( identifier ) ) )
|
{
|
||||||
|
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;
|
return PenumbraApiEc.CharacterCollectionExists;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@ public class TempModManager
|
||||||
if( Collections[ i ].Collection == collection )
|
if( Collections[ i ].Collection == collection )
|
||||||
{
|
{
|
||||||
CollectionChanged?.Invoke( CollectionType.Temporary, collection, null, Collections[ i ].DisplayName );
|
CollectionChanged?.Invoke( CollectionType.Temporary, collection, null, Collections[ i ].DisplayName );
|
||||||
Collections.Delete( i );
|
Collections.Delete( i-- );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue