]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix material reclaimer sound issue (#15278)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Mon, 10 Apr 2023 21:30:33 +0000 (17:30 -0400)
committerGitHub <noreply@github.com>
Mon, 10 Apr 2023 21:30:33 +0000 (16:30 -0500)
* fix material reclaimer sound issue

* this, too

Content.Server/Materials/MaterialReclaimerSystem.cs
Content.Shared/Materials/MaterialReclaimerComponent.cs
Content.Shared/Materials/SharedMaterialReclaimerSystem.cs
Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml

index e46e82de0263238f64ba5223119ce9f3529dc833..367daf3f0aa2d92c82133f01450723a727ebda26 100644 (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);
index 283ade2cd9151f7d12881eecc0754f003ce6db46..b29776a851d6af5d0252fed004daed58695db26b 100644 (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;
index 18a744e80d2df33c1fc644035eb45116b91c4288..8d8784a17389db71ee7eb6948867902369d7041d 100644 (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;
index 26d4adf09dd21ec2eefcda24d8e2dc1937c097c3..a7d637af728bb460e92500d1922a9e710e9e8c7d 100644 (file)
@@ -76,6 +76,7 @@
       - IdCard
       tags:
       - HighRiskItem
+    soundCooldown: 0
     sound:
       path: /Audio/Ambience/Objects/crushing.ogg
       params: