]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix TEG assert (#26881)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Thu, 11 Apr 2024 12:22:21 +0000 (14:22 +0200)
committerGitHub <noreply@github.com>
Thu, 11 Apr 2024 12:22:21 +0000 (22:22 +1000)
It's possible to trigger this by stacking it weirdly with the spawn panel. Just make it bail instead.

Content.Server/Power/Generation/Teg/TegNodeGroup.cs

index ed6b46e304aa804d68aab9460ae2fdcdd890c9ca..3c937f8f71d03dcd09b810297451f889ab16d70d 100644 (file)
@@ -66,11 +66,16 @@ public sealed class TegNodeGroup : BaseNodeGroup
 
     public override void LoadNodes(List<Node> groupNodes)
     {
-        DebugTools.Assert(groupNodes.Count <= 3, "The TEG has at most 3 parts");
         DebugTools.Assert(_entityManager != null);
 
         base.LoadNodes(groupNodes);
 
+        if (groupNodes.Count > 3)
+        {
+            // Somehow got more TEG parts. Probably shenanigans. Bail.
+            return;
+        }
+
         Generator = groupNodes.OfType<TegNodeGenerator>().SingleOrDefault();
         if (Generator != null)
         {