Fix solution corruption when grinding a stack of items (#24242)

Fix corruption when grinding a stack of items
This commit is contained in:
Tayrtahn
2024-01-18 16:39:13 -05:00
committed by GitHub
parent 4315531a3f
commit 20dadf45ec

View File

@@ -103,7 +103,12 @@ namespace Content.Server.Kitchen.EntitySystems
if (fitsCount <= 0)
continue;
solution.ScaleSolution(fitsCount);
// Make a copy of the solution to scale
// Otherwise we'll actually change the volume of the remaining stack too
var scaledSolution = new Solution(solution);
scaledSolution.ScaleSolution(fitsCount);
solution = scaledSolution;
_stackSystem.SetCount(item, stack.Count - fitsCount); // Setting to 0 will QueueDel
}
else