Fix TEG assert (#26881)

It's possible to trigger this by stacking it weirdly with the spawn panel. Just make it bail instead.
This commit is contained in:
Pieter-Jan Briers
2024-04-11 14:22:21 +02:00
committed by GitHub
parent 2bcdb608a3
commit 210ed3ece4

View 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)
{