fix-lathe-recipe-dupes (#17473)

This commit is contained in:
Nemanja
2023-06-19 13:43:20 -04:00
committed by GitHub
parent 8610249277
commit 910c2da9bb

View File

@@ -101,7 +101,7 @@ namespace Content.Server.Lathe
{ {
var ev = new LatheGetRecipesEvent(uid) var ev = new LatheGetRecipesEvent(uid)
{ {
Recipes = component.StaticRecipes Recipes = new List<string>(component.StaticRecipes)
}; };
RaiseLocalEvent(uid, ev); RaiseLocalEvent(uid, ev);
return ev.Recipes; return ev.Recipes;
@@ -195,7 +195,7 @@ namespace Content.Server.Lathe
foreach (var recipe in latheComponent.DynamicRecipes) foreach (var recipe in latheComponent.DynamicRecipes)
{ {
if (!component.UnlockedRecipes.Contains(recipe)) if (!component.UnlockedRecipes.Contains(recipe) || args.Recipes.Contains(recipe))
continue; continue;
args.Recipes.Add(recipe); args.Recipes.Add(recipe);
} }