]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix industrial reagent grinder bug, second attempt (#39690)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Sat, 16 Aug 2025 19:54:15 +0000 (21:54 +0200)
committerGitHub <noreply@github.com>
Sat, 16 Aug 2025 19:54:15 +0000 (21:54 +0200)
* fix recycler 3

* Update Resources/Prototypes/Entities/Structures/Machines/reagent_grinder.yml

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

index 7de0d630e0bc6731d19a98b5d195704efb2a0319..15ff93833def115d5bc7bd671a3d9daed70c3d8b 100644 (file)
@@ -184,19 +184,22 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
 
         var xform = Transform(uid);
 
-        SpawnMaterialsFromComposition(uid, item, completion * component.Efficiency, xform: xform);
+        if (component.ReclaimMaterials)
+            SpawnMaterialsFromComposition(uid, item, completion * component.Efficiency, xform: xform);
 
         if (CanGib(uid, item, component))
         {
             var logImpact = HasComp<HumanoidAppearanceComponent>(item) ? LogImpact.Extreme : LogImpact.Medium;
             _adminLogger.Add(LogType.Gib, logImpact, $"{ToPrettyString(item):victim} was gibbed by {ToPrettyString(uid):entity} ");
-            SpawnChemicalsFromComposition(uid, item, completion, false, component, xform);
+            if (component.ReclaimSolutions)
+                SpawnChemicalsFromComposition(uid, item, completion, false, component, xform);
             _body.GibBody(item, true);
             _appearance.SetData(uid, RecyclerVisuals.Bloody, true);
         }
         else
         {
-            SpawnChemicalsFromComposition(uid, item, completion, true, component, xform);
+            if (component.ReclaimSolutions)
+                SpawnChemicalsFromComposition(uid, item, completion, true, component, xform);
         }
 
         QueueDel(item);
index f48a1cb47887afaeb847060c85677f4b6373b8ab..ff0adf875353b3695705345bd4bccfef7f9ace3b 100644 (file)
@@ -69,6 +69,20 @@ public sealed partial class MaterialReclaimerComponent : Component
     [DataField]
     public string? SolutionContainerId;
 
+    /// <summary>
+    /// Can this reclaimer reclaim materials?
+    /// They will be spawned as material stacks.
+    /// </summary>
+    [DataField]
+    public bool ReclaimMaterials = true;
+
+    /// <summary>
+    /// Can this reclaimer reclaim solutions?
+    /// The reclaimed reagents will be stored in a buffer or spilled on the ground if that is full.
+    /// </summary>
+    [DataField]
+    public bool ReclaimSolutions = true;
+
     /// <summary>
     /// If the reclaimer should attempt to reclaim all solutions or just drainable ones
     /// Difference between Recycler and Industrial Reagent Grinder
index f384de64ab7003517247fc73afa6bedaaedf5ec0..d423a47ae95ff626119d444c64c446b7929a8819 100644 (file)
@@ -73,6 +73,7 @@
       tags:
       - HighRiskItem #ian meat
     efficiency: 0.9
+    reclaimMaterials: false # Materials have ExtractableComponent, which is whitelisted, so we have to avoid infinite recycling loops
     onlyReclaimDrainable: false
     solutionContainerId: output
   - type: Sprite