ClientPriceGunSystem.cs 735 B

12345678910111213141516171819202122
  1. using Content.Shared.Cargo.Components;
  2. using Content.Shared.Timing;
  3. using Content.Shared.Cargo.Systems;
  4. namespace Content.Client.Cargo.Systems;
  5. /// <summary>
  6. /// This handles...
  7. /// </summary>
  8. public sealed class ClientPriceGunSystem : SharedPriceGunSystem
  9. {
  10. [Dependency] private readonly UseDelaySystem _useDelay = default!;
  11. protected override bool GetPriceOrBounty(Entity<PriceGunComponent> entity, EntityUid target, EntityUid user)
  12. {
  13. if (!TryComp(entity, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((entity, useDelay)))
  14. return false;
  15. // It feels worse if the cooldown is predicted but the popup isn't! So only do the cooldown reset on the server.
  16. return true;
  17. }
  18. }