]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix stacks only recycling one instead of the stack amount (#38433)
authorbeck-thompson <107373427+beck-thompson@users.noreply.github.com>
Wed, 18 Jun 2025 21:14:01 +0000 (14:14 -0700)
committerGitHub <noreply@github.com>
Wed, 18 Jun 2025 21:14:01 +0000 (23:14 +0200)
* fix

* Fixes

Content.Server/Materials/MaterialReclaimerSystem.cs

index 60b1a99e31d6a9aa042dac08ba799bd784da89b4..1e9acbd56811c44c8284350ab62d6756586ecf07 100644 (file)
@@ -19,6 +19,7 @@ using Content.Shared.Materials;
 using Content.Shared.Mind;
 using Content.Shared.Nutrition.EntitySystems;
 using Content.Shared.Power;
+using Content.Shared.Stacks;
 using Robust.Server.GameObjects;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
@@ -214,9 +215,12 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
         if (!Resolve(item, ref composition, false))
             return;
 
+        // If more of these checks are needed, use an event instead
+        var modifier = CompOrNull<StackComponent>(item)?.Count ?? 1.0f;
+
         foreach (var (material, amount) in composition.MaterialComposition)
         {
-            var outputAmount = (int) (amount * efficiency);
+            var outputAmount = (int) (amount * efficiency * modifier);
             _materialStorage.TryChangeMaterialAmount(reclaimer, material, outputAmount, storage);
         }