InventorySystem.InventorySlotEnumerator enumerator = _invSystem.GetSlotEnumerator(equipee);
bool shouldLayerShow = true;
- while (enumerator.NextItem(out EntityUid item))
+ while (enumerator.NextItem(out EntityUid item, out SlotDefinition? slot))
{
if (TryComp(item, out HideLayerClothingComponent? comp))
{
if (comp.Slots.Contains(layer))
{
- //Checks for mask toggling. TODO: Make a generic system for this
- if (comp.HideOnToggle && TryComp(item, out MaskComponent? mask) && TryComp(item, out ClothingComponent? clothing))
+ if (TryComp(item, out ClothingComponent? clothing) && clothing.Slots == slot.SlotFlags)
{
- if (clothing.EquippedPrefix != mask.EquippedPrefix)
+ //Checks for mask toggling. TODO: Make a generic system for this
+ if (comp.HideOnToggle && TryComp(item, out MaskComponent? mask))
+ {
+ if (clothing.EquippedPrefix != mask.EquippedPrefix)
+ {
+ shouldLayerShow = false;
+ break;
+ }
+ }
+ else
{
shouldLayerShow = false;
break;
}
}
- else
- {
- shouldLayerShow = false;
- break;
- }
}
}
}