Add support for printing reagents in lathes (#30476)

* Add support for reagents in lathes

* missing locale
This commit is contained in:
Nemanja
2024-08-01 00:15:05 -04:00
committed by GitHub
parent 4b7325098a
commit 2c26be606f
17 changed files with 239 additions and 139 deletions

View File

@@ -81,9 +81,9 @@ namespace Content.Shared.Construction
{
var partRecipe = recipes[0];
if (recipes.Count > 1)
partRecipe = recipes.MinBy(p => p.RequiredMaterials.Values.Sum());
partRecipe = recipes.MinBy(p => p.Materials.Values.Sum());
foreach (var (mat, matAmount) in partRecipe!.RequiredMaterials)
foreach (var (mat, matAmount) in partRecipe!.Materials)
{
materials.TryAdd(mat, 0);
materials[mat] += matAmount * amount * coefficient;
@@ -101,9 +101,9 @@ namespace Content.Shared.Construction
{
var partRecipe = recipes[0];
if (recipes.Count > 1)
partRecipe = recipes.MinBy(p => p.RequiredMaterials.Values.Sum());
partRecipe = recipes.MinBy(p => p.Materials.Values.Sum());
foreach (var (mat, matAmount) in partRecipe!.RequiredMaterials)
foreach (var (mat, matAmount) in partRecipe!.Materials)
{
materials.TryAdd(mat, 0);
materials[mat] += matAmount * amount * coefficient;