From bafe5dc784d11fe1dfdeb92d85494741bd13099e Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 19 Sep 2018 12:41:33 -0400 Subject: [PATCH] Fixed block break crash --- .../anuke/mindustry/world/blocks/power/PowerGraph.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java index 9fd5432b05..0bc61a6438 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java @@ -108,13 +108,7 @@ public class PowerGraph{ } public void remove(Tile tile){ - for(Tile other : all){ - other.entity.power.graph = null; - } - - all.remove(tile); - producers.remove(tile); - consumers.remove(tile); + clear(); for(Tile other : tile.block().getPowerConnections(tile, outArray1)){ if(other.entity.power == null || other.entity.power.graph != null) continue; @@ -124,7 +118,7 @@ public class PowerGraph{ while(queue.size > 0){ Tile child = queue.removeFirst(); child.entity.power.graph = graph; - add(child); + graph.add(child); for(Tile next : child.block().getPowerConnections(child, outArray2)){ if(next != tile && next.entity.power != null && next.entity.power.graph == null){ queue.addLast(next);