Unhardcode some logic related to objects with battery slots. Minor fix to fire helmets. (#11734)

This commit is contained in:
Mervill
2022-10-15 13:15:39 -07:00
committed by GitHub
parent 581a805063
commit c11c11bace
13 changed files with 86 additions and 101 deletions

View File

@@ -125,6 +125,16 @@ namespace Content.Shared.Containers.ItemSlots
else
Dirty(itemSlots);
}
public bool TryGetSlotById(EntityUid uid, string slotId, [NotNullWhen(true)] out ItemSlot? itemSlot, ItemSlotsComponent? component = null)
{
itemSlot = null;
if (!Resolve(uid, ref component))
return false;
return component.Slots.TryGetValue(slotId, out itemSlot);
}
#endregion
#region Interactions