private void OnUnequipped(EntityUid uid, SuitSensorComponent component, UnequippedEvent args) { if (args.Slot != component.ActivationSlot) { return; } component.User = null; }
/// <summary> /// Calls Unequipped on all components that implement the IUnequipped interface /// on an entity that has been equipped. /// </summary> public void UnequippedInteraction(IEntity user, IEntity equipped, EquipmentSlotDefines.Slots slot) { var unequipMsg = new UnequippedEvent(user, equipped, slot); RaiseLocalEvent(equipped.Uid, unequipMsg); if (unequipMsg.Handled) { return; } var comps = equipped.GetAllComponents <IUnequipped>().ToList(); // Call Thrown on all components that implement the interface foreach (var comp in comps) { comp.Unequipped(new UnequippedEventArgs(user, slot)); } }