Fix industrial reagent grinder bug, second attempt (#39690)

* fix recycler 3

* Update Resources/Prototypes/Entities/Structures/Machines/reagent_grinder.yml
This commit is contained in:
slarticodefast
2025-08-16 21:54:15 +02:00
committed by GitHub
parent 09a8b78919
commit 85158a3d48
3 changed files with 21 additions and 3 deletions

View File

@@ -184,18 +184,21 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
var xform = Transform(uid);
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} ");
if (component.ReclaimSolutions)
SpawnChemicalsFromComposition(uid, item, completion, false, component, xform);
_body.GibBody(item, true);
_appearance.SetData(uid, RecyclerVisuals.Bloody, true);
}
else
{
if (component.ReclaimSolutions)
SpawnChemicalsFromComposition(uid, item, completion, true, component, xform);
}

View 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

View 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