]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
FoodSequence fix (#32034)
authorEd <96445749+TheShuEd@users.noreply.github.com>
Tue, 10 Sep 2024 13:08:04 +0000 (16:08 +0300)
committerGitHub <noreply@github.com>
Tue, 10 Sep 2024 13:08:04 +0000 (15:08 +0200)
Update FoodSequenceSystem.cs

Content.Server/Nutrition/EntitySystems/FoodSequenceSystem.cs

index f7d8588716fc34355f23f36c216ed7a0ea230f57..367b16a268218867c93cf57bbbc1cb56c267992e 100644 (file)
@@ -116,14 +116,8 @@ public sealed class FoodSequenceSystem : SharedFoodSequenceSystem
             return false;
 
         //looking for a suitable FoodSequence prototype
-        ProtoId<FoodSequenceElementPrototype> elementProto = string.Empty;
-        foreach (var pair in element.Comp.Entries)
-        {
-            if (pair.Key == start.Comp.Key)
-            {
-                elementProto = pair.Value;
-            }
-        }
+        if (!element.Comp.Entries.TryGetValue(start.Comp.Key, out var elementProto))
+            return false;
         if (!_proto.TryIndex(elementProto, out var elementIndexed))
             return false;