From 2773e3f4fb9711350f9ec623a032c6598459dc14 Mon Sep 17 00:00:00 2001 From: Whatstone <166147148+whatston3@users.noreply.github.com> Date: Thu, 23 Jul 2026 00:52:53 +0000 Subject: [PATCH] Recyclers: spill without valid solutions (#44344) * Recyclers: spill without valid solutions * Early return on empty --- .../Materials/MaterialReclaimerSystem.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Content.Server/Materials/MaterialReclaimerSystem.cs b/Content.Server/Materials/MaterialReclaimerSystem.cs index 27a259fe2c..ea830e9187 100644 --- a/Content.Server/Materials/MaterialReclaimerSystem.cs +++ b/Content.Server/Materials/MaterialReclaimerSystem.cs @@ -219,11 +219,15 @@ public sealed partial class MaterialReclaimerSystem : SharedMaterialReclaimerSys TransformComponent? xform = null, PhysicalCompositionComponent? composition = null) { - if (!Resolve(reclaimer, ref reclaimerComponent, ref xform) || reclaimerComponent.SolutionContainerId == null) + if (!Resolve(reclaimer, ref reclaimerComponent, ref xform)) return; efficiency *= reclaimerComponent.Efficiency; + // Solution will be empty, nothing to do. + if (efficiency <= 0) + return; + var totalChemicals = new Solution(); if (Resolve(item, ref composition, false)) @@ -254,9 +258,13 @@ public sealed partial class MaterialReclaimerSystem : SharedMaterialReclaimerSys } } - if (!_solutionContainer.TryGetSolution(reclaimer, reclaimerComponent.SolutionContainerId, out var outputSolution) || - !_solutionContainer.TryTransferSolution(outputSolution.Value, totalChemicals, totalChemicals.Volume) || - totalChemicals.Volume > 0) + // Transfer or spill the solution if there's anything to move. + if (totalChemicals.Volume <= 0) + return; + + if (reclaimerComponent.SolutionContainerId == null || + !_solutionContainer.TryGetSolution(reclaimer, reclaimerComponent.SolutionContainerId, out var outputSolution) || + !_solutionContainer.TryTransferSolution(outputSolution.Value, totalChemicals, totalChemicals.Volume)) { _puddle.TrySpillAt(reclaimer, totalChemicals, out _, sound, transformComponent: xform); }