mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 20:24:17 +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))
|
if (!_tempCollections.CollectionByName(collectionName, out var collection))
|
||||||
return PenumbraApiEc.CollectionMissing;
|
return PenumbraApiEc.CollectionMissing;
|
||||||
|
|
||||||
if (!forceAssignment
|
if (forceAssignment)
|
||||||
&& (_tempCollections.Collections.Individuals.ContainsKey(identifier)
|
{
|
||||||
|| _collectionManager.Individuals.Individuals.ContainsKey(identifier)))
|
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;
|
return PenumbraApiEc.CharacterCollectionExists;
|
||||||
|
}
|
||||||
|
|
||||||
var group = _tempCollections.Collections.GetGroup(identifier);
|
var group = _tempCollections.Collections.GetGroup(identifier);
|
||||||
return _tempCollections.AddIdentifier(collection, group)
|
return _tempCollections.AddIdentifier(collection, group)
|
||||||
|
|
|
||||||
|
|
@ -67,11 +67,11 @@ public class TempCollectionManager : IDisposable
|
||||||
collection.ClearCache();
|
collection.ClearCache();
|
||||||
for (var i = 0; i < Collections.Count; ++i)
|
for (var i = 0; i < Collections.Count; ++i)
|
||||||
{
|
{
|
||||||
if (Collections[i].Collection == collection)
|
if (Collections[i].Collection != collection)
|
||||||
{
|
continue;
|
||||||
_communicator.CollectionChange.Invoke(CollectionType.Temporary, collection, null, Collections[i].DisplayName);
|
|
||||||
Collections.Delete(i);
|
_communicator.CollectionChange.Invoke(CollectionType.Temporary, collection, null, Collections[i].DisplayName);
|
||||||
}
|
Collections.Delete(i--);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue