From 64a93770067a11e768bb85c7219bb1118b71add4 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 7 Jan 2023 11:36:48 -0500 Subject: [PATCH] #8040 but better --- core/src/mindustry/world/blocks/power/PowerGraph.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/mindustry/world/blocks/power/PowerGraph.java b/core/src/mindustry/world/blocks/power/PowerGraph.java index 7c5a3f26c8..11710107eb 100644 --- a/core/src/mindustry/world/blocks/power/PowerGraph.java +++ b/core/src/mindustry/world/blocks/power/PowerGraph.java @@ -259,6 +259,13 @@ public class PowerGraph{ public void addGraph(PowerGraph graph){ if(graph == this) return; + + //merge into other graph instead. + if(graph.all.size > all.size){ + graph.addGraph(this); + return; + } + //other entity should be removed as the graph was merged if(graph.entity != null) graph.entity.remove();