Cargo request and bounty console deny sound cooldown (#37234)

* Cargo bounty console deny sound cooldown

* ordering computer cooldown

* Update Content.Shared/Cargo/Components/CargoBountyConsoleComponent.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Shared/Cargo/Components/CargoBountyConsoleComponent.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Server/Cargo/Systems/CargoSystem.Bounty.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* AutoGenerateComponentPause

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
themias
2025-05-07 20:34:44 -04:00
committed by GitHub
parent b3c4c7c32b
commit 14adb1ff01
4 changed files with 38 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ using JetBrains.Annotations;
using Robust.Shared.Audio;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
namespace Content.Server.Cargo.Systems
@@ -24,6 +25,7 @@ namespace Content.Server.Cargo.Systems
{
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly EmagSystem _emag = default!;
[Dependency] private readonly IGameTiming _timing = default!;
private void InitializeConsole()
{
@@ -431,7 +433,11 @@ namespace Content.Server.Cargo.Systems
private void PlayDenySound(EntityUid uid, CargoOrderConsoleComponent component)
{
_audio.PlayPvs(_audio.ResolveSound(component.ErrorSound), uid);
if (_timing.CurTime >= component.NextDenySoundTime)
{
component.NextDenySoundTime = _timing.CurTime + component.DenySoundDelay;
_audio.PlayPvs(_audio.ResolveSound(component.ErrorSound), uid);
}
}
private static CargoOrderData GetOrderData(CargoConsoleAddOrderMessage args, CargoProductPrototype cargoProduct, int id, ProtoId<CargoAccountPrototype> account)