Fix stacks only recycling one instead of the stack amount (#38433)

* fix

* Fixes
This commit is contained in:
beck-thompson 2025-06-18 14:14:01 -07:00 committed by Quanteey
parent 567aaa9ae7
commit fac62f9d81
1 changed files with 5 additions and 1 deletions

View 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);
}