From 210ed3ece4230a7fa31c12a43f4fdee0f0614915 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Thu, 11 Apr 2024 14:22:21 +0200 Subject: [PATCH] Fix TEG assert (#26881) 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Content.Server/Power/Generation/Teg/TegNodeGroup.cs b/Content.Server/Power/Generation/Teg/TegNodeGroup.cs index ed6b46e304..3c937f8f71 100644 --- a/Content.Server/Power/Generation/Teg/TegNodeGroup.cs +++ b/Content.Server/Power/Generation/Teg/TegNodeGroup.cs @@ -66,11 +66,16 @@ public sealed class TegNodeGroup : BaseNodeGroup public override void LoadNodes(List 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().SingleOrDefault(); if (Generator != null) {