AntiGravityClothingSystem.cs 672 B

1234567891011121314151617181920212223
  1. using Content.Shared.Clothing.Components;
  2. using Content.Shared.Gravity;
  3. using Content.Shared.Inventory;
  4. namespace Content.Shared.Clothing.EntitySystems;
  5. public sealed class AntiGravityClothingSystem : EntitySystem
  6. {
  7. /// <inheritdoc/>
  8. public override void Initialize()
  9. {
  10. SubscribeLocalEvent<AntiGravityClothingComponent, InventoryRelayedEvent<IsWeightlessEvent>>(OnIsWeightless);
  11. }
  12. private void OnIsWeightless(Entity<AntiGravityClothingComponent> ent, ref InventoryRelayedEvent<IsWeightlessEvent> args)
  13. {
  14. if (args.Args.Handled)
  15. return;
  16. args.Args.Handled = true;
  17. args.Args.IsWeightless = true;
  18. }
  19. }