mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Merge API changes.
This commit is contained in:
parent
d32e777426
commit
fb2fe05409
2 changed files with 14 additions and 8 deletions
|
|
@ -848,10 +848,16 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
|||
if (!_tempCollections.CollectionByName(collectionName, out var collection))
|
||||
return PenumbraApiEc.CollectionMissing;
|
||||
|
||||
if (!forceAssignment
|
||||
&& (_tempCollections.Collections.Individuals.ContainsKey(identifier)
|
||||
|| _collectionManager.Individuals.Individuals.ContainsKey(identifier)))
|
||||
if (forceAssignment)
|
||||
{
|
||||
if (_tempCollections.Collections.Individuals.ContainsKey(identifier) && !_tempCollections.Collections.Delete(identifier))
|
||||
return PenumbraApiEc.AssignmentDeletionFailed;
|
||||
}
|
||||
else if (_tempCollections.Collections.Individuals.ContainsKey(identifier)
|
||||
|| _collectionManager.Individuals.Individuals.ContainsKey(identifier))
|
||||
{
|
||||
return PenumbraApiEc.CharacterCollectionExists;
|
||||
}
|
||||
|
||||
var group = _tempCollections.Collections.GetGroup(identifier);
|
||||
return _tempCollections.AddIdentifier(collection, group)
|
||||
|
|
|
|||
|
|
@ -67,11 +67,11 @@ public class TempCollectionManager : IDisposable
|
|||
collection.ClearCache();
|
||||
for (var i = 0; i < Collections.Count; ++i)
|
||||
{
|
||||
if (Collections[i].Collection == collection)
|
||||
{
|
||||
_communicator.CollectionChange.Invoke(CollectionType.Temporary, collection, null, Collections[i].DisplayName);
|
||||
Collections.Delete(i);
|
||||
}
|
||||
if (Collections[i].Collection != collection)
|
||||
continue;
|
||||
|
||||
_communicator.CollectionChange.Invoke(CollectionType.Temporary, collection, null, Collections[i].DisplayName);
|
||||
Collections.Delete(i--);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue