1
0

SharedHotPotatoSystem.cs 499 B

123456789101112131415161718
  1. using Robust.Shared.Containers;
  2. namespace Content.Shared.HotPotato;
  3. public abstract class SharedHotPotatoSystem : EntitySystem
  4. {
  5. public override void Initialize()
  6. {
  7. base.Initialize();
  8. SubscribeLocalEvent<HotPotatoComponent, ContainerGettingRemovedAttemptEvent>(OnRemoveAttempt);
  9. }
  10. private void OnRemoveAttempt(EntityUid uid, HotPotatoComponent comp, ContainerGettingRemovedAttemptEvent args)
  11. {
  12. if (!comp.CanTransfer)
  13. args.Cancel();
  14. }
  15. }