Skip to content

Commit 6e4e28f

Browse files
committed
Fix disabling conditional shapes.
1 parent e326e3d commit 6e4e28f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Penumbra/Collections/Cache/ShpCache.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ internal IReadOnlyDictionary<ShapeString, ShpHashSet> State(ShapeConnectorCondit
2222

2323
public int EnabledCount { get; private set; }
2424

25-
26-
public bool ShouldBeEnabled(ShapeConnectorCondition connector, in ShapeString shape, HumanSlot slot, PrimaryId id)
27-
=> State(connector).TryGetValue(shape, out var value) && value.Contains(slot, id);
28-
2925
public sealed class ShpHashSet : HashSet<(HumanSlot Slot, PrimaryId Id)>
3026
{
3127
private readonly BitArray _allIds = new(ShapeManager.ModelSlotSize);
@@ -148,13 +144,14 @@ protected override void RevertModInternal(ShpIdentifier identifier)
148144

149145
void Func(Dictionary<ShapeString, ShpHashSet> dict)
150146
{
151-
if (!_shpData.TryGetValue(identifier.Shape, out var value))
147+
if (!dict.TryGetValue(identifier.Shape, out var value))
152148
return;
153149

154-
if (value.TrySet(identifier.Slot, identifier.Id, ShpEntry.False) && value.IsEmpty)
150+
if (value.TrySet(identifier.Slot, identifier.Id, ShpEntry.False))
155151
{
156152
--EnabledCount;
157-
_shpData.Remove(identifier.Shape);
153+
if (value.IsEmpty)
154+
dict.Remove(identifier.Shape);
158155
}
159156
}
160157
}

0 commit comments

Comments
 (0)