Fix stacks only recycling one instead of the stack amount (#38433)
* fix * Fixes
This commit is contained in:
@@ -19,6 +19,7 @@ using Content.Shared.Materials;
|
|||||||
using Content.Shared.Mind;
|
using Content.Shared.Mind;
|
||||||
using Content.Shared.Nutrition.EntitySystems;
|
using Content.Shared.Nutrition.EntitySystems;
|
||||||
using Content.Shared.Power;
|
using Content.Shared.Power;
|
||||||
|
using Content.Shared.Stacks;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
@@ -214,9 +215,12 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
|
|||||||
if (!Resolve(item, ref composition, false))
|
if (!Resolve(item, ref composition, false))
|
||||||
return;
|
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)
|
foreach (var (material, amount) in composition.MaterialComposition)
|
||||||
{
|
{
|
||||||
var outputAmount = (int) (amount * efficiency);
|
var outputAmount = (int) (amount * efficiency * modifier);
|
||||||
_materialStorage.TryChangeMaterialAmount(reclaimer, material, outputAmount, storage);
|
_materialStorage.TryChangeMaterialAmount(reclaimer, material, outputAmount, storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user