private void OnInventoryFlashAttempt(EntityUid uid, InventoryComponent component, FlashAttemptEvent args) { // Forward the event to the glasses, if any. if (_inventorySystem.TryGetSlotEntity(uid, "eyes", out var slotEntity, component)) { RaiseLocalEvent(slotEntity.Value, args); } }
private void OnInventoryFlashAttempt(EntityUid uid, InventoryComponent component, FlashAttemptEvent args) { foreach (var slot in new string[] { "head", "eyes", "mask" }) { if (args.Cancelled) { break; } if (_inventorySystem.TryGetSlotEntity(uid, slot, out var item, component)) { RaiseLocalEvent(item.Value, args, true); } } }