fix material reclaimer sound issue (#15278)

* fix material reclaimer sound issue

* this, too
This commit is contained in:
Nemanja
2023-04-10 17:30:33 -04:00
committed by GitHub
parent 8ea9957736
commit 2d78c50f3e
4 changed files with 9 additions and 1 deletions

View File

@@ -160,6 +160,8 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
if (!Resolve(uid, ref component))
return;
base.Reclaim(uid, item, completion, component);
var xform = Transform(uid);
SpawnMaterialsFromComposition(uid, item, completion * component.Efficiency, xform: xform);

View File

@@ -3,7 +3,6 @@ using Content.Shared.Construction.Prototypes;
using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

View File

@@ -34,6 +34,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
{
SubscribeLocalEvent<MaterialReclaimerComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<MaterialReclaimerComponent, ComponentHandleState>(OnHandleState);
SubscribeLocalEvent<MaterialReclaimerComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<MaterialReclaimerComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<MaterialReclaimerComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<MaterialReclaimerComponent, GotEmaggedEvent>(OnEmagged);
@@ -60,6 +61,11 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
component.ItemsProcessed = state.ItemsProcessed;
}
private void OnShutdown(EntityUid uid, MaterialReclaimerComponent component, ComponentShutdown args)
{
component.Stream?.Stop();
}
private void OnUnpaused(EntityUid uid, MaterialReclaimerComponent component, ref EntityUnpausedEvent args)
{
component.NextSound += args.PausedTime;

View File

@@ -76,6 +76,7 @@
- IdCard
tags:
- HighRiskItem
soundCooldown: 0
sound:
path: /Audio/Ambience/Objects/crushing.ogg
params: