private void OnInventoryRequestMessage(EntityUid uid, VendingMachineComponent component, InventorySyncRequestMessage args)
        {
            if (!this.IsPowered(uid, EntityManager))
            {
                return;
            }

            var inventory = new List <VendingMachineInventoryEntry>(component.Inventory);

            if (component.Emagged)
            {
                inventory.AddRange(component.EmaggedInventory);
            }
            if (component.Contraband)
            {
                inventory.AddRange(component.ContrabandInventory);
            }

            component.UserInterface?.SendMessage(new VendingMachineInventoryMessage(inventory));
        }
Example #2
0
        private void OnInventoryRequestMessage(EntityUid uid, VendingMachineComponent component, InventorySyncRequestMessage args)
        {
            if (!IsPowered(uid, component))
            {
                return;
            }

            component.UserInterface?.SendMessage(new VendingMachineInventoryMessage(component.Inventory));
        }