ReagentDispenser ECS (#11418)

This commit is contained in:
0x6273
2022-10-04 02:57:32 +02:00
committed by GitHub
parent f89b4f0a1d
commit 0c24f8b69b
17 changed files with 351 additions and 640 deletions

View File

@@ -532,9 +532,10 @@ namespace Content.Shared.Containers.ItemSlots
/// <summary>
/// Get the contents of some item slot.
/// </summary>
public EntityUid? GetItem(EntityUid uid, string id, ItemSlotsComponent? itemSlots = null)
/// <returns>The item in the slot, or null if the slot is empty or the entity doesn't have an <see cref="ItemSlotsComponent"/>.</returns>
public EntityUid? GetItemOrNull(EntityUid uid, string id, ItemSlotsComponent? itemSlots = null)
{
if (!Resolve(uid, ref itemSlots))
if (!Resolve(uid, ref itemSlots, logMissing: false))
return null;
return itemSlots.Slots.GetValueOrDefault(id)?.Item;