mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Fix disabling conditional shapes.
This commit is contained in:
parent
e326e3d809
commit
6e4e28fa00
1 changed files with 4 additions and 7 deletions
|
|
@ -22,10 +22,6 @@ public sealed class ShpCache(MetaFileManager manager, ModCollection collection)
|
|||
|
||||
public int EnabledCount { get; private set; }
|
||||
|
||||
|
||||
public bool ShouldBeEnabled(ShapeConnectorCondition connector, in ShapeString shape, HumanSlot slot, PrimaryId id)
|
||||
=> State(connector).TryGetValue(shape, out var value) && value.Contains(slot, id);
|
||||
|
||||
public sealed class ShpHashSet : HashSet<(HumanSlot Slot, PrimaryId Id)>
|
||||
{
|
||||
private readonly BitArray _allIds = new(ShapeManager.ModelSlotSize);
|
||||
|
|
@ -148,13 +144,14 @@ public sealed class ShpCache(MetaFileManager manager, ModCollection collection)
|
|||
|
||||
void Func(Dictionary<ShapeString, ShpHashSet> dict)
|
||||
{
|
||||
if (!_shpData.TryGetValue(identifier.Shape, out var value))
|
||||
if (!dict.TryGetValue(identifier.Shape, out var value))
|
||||
return;
|
||||
|
||||
if (value.TrySet(identifier.Slot, identifier.Id, ShpEntry.False) && value.IsEmpty)
|
||||
if (value.TrySet(identifier.Slot, identifier.Id, ShpEntry.False))
|
||||
{
|
||||
--EnabledCount;
|
||||
_shpData.Remove(identifier.Shape);
|
||||
if (value.IsEmpty)
|
||||
dict.Remove(identifier.Shape);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue