mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-23 21:12:52 -08:00
Fixed block break crash
This commit is contained in:
parent
5325488099
commit
bafe5dc784
1 changed files with 2 additions and 8 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue