From 85158a3d4826a83e0e9ac3ad93d175a7a2995423 Mon Sep 17 00:00:00 2001 From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Sat, 16 Aug 2025 21:54:15 +0200 Subject: [PATCH] Fix industrial reagent grinder bug, second attempt (#39690) * fix recycler 3 * Update Resources/Prototypes/Entities/Structures/Machines/reagent_grinder.yml --- .../Materials/MaterialReclaimerSystem.cs | 9 ++++++--- .../Materials/MaterialReclaimerComponent.cs | 14 ++++++++++++++ .../Structures/Machines/reagent_grinder.yml | 1 + 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Content.Server/Materials/MaterialReclaimerSystem.cs b/Content.Server/Materials/MaterialReclaimerSystem.cs index 7de0d630e0..15ff93833d 100644 --- a/Content.Server/Materials/MaterialReclaimerSystem.cs +++ b/Content.Server/Materials/MaterialReclaimerSystem.cs @@ -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(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); diff --git a/Content.Shared/Materials/MaterialReclaimerComponent.cs b/Content.Shared/Materials/MaterialReclaimerComponent.cs index f48a1cb478..ff0adf8753 100644 --- a/Content.Shared/Materials/MaterialReclaimerComponent.cs +++ b/Content.Shared/Materials/MaterialReclaimerComponent.cs @@ -69,6 +69,20 @@ public sealed partial class MaterialReclaimerComponent : Component [DataField] public string? SolutionContainerId; + /// + /// Can this reclaimer reclaim materials? + /// They will be spawned as material stacks. + /// + [DataField] + public bool ReclaimMaterials = true; + + /// + /// Can this reclaimer reclaim solutions? + /// The reclaimed reagents will be stored in a buffer or spilled on the ground if that is full. + /// + [DataField] + public bool ReclaimSolutions = true; + /// /// If the reclaimer should attempt to reclaim all solutions or just drainable ones /// Difference between Recycler and Industrial Reagent Grinder diff --git a/Resources/Prototypes/Entities/Structures/Machines/reagent_grinder.yml b/Resources/Prototypes/Entities/Structures/Machines/reagent_grinder.yml index f384de64ab..d423a47ae9 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/reagent_grinder.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/reagent_grinder.yml @@ -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 -- 2.51.2