Avoid recursion
This commit is contained in:
@@ -3,6 +3,7 @@ package mindustry.world.blocks.distribution;
|
|||||||
import arc.*;
|
import arc.*;
|
||||||
import arc.func.*;
|
import arc.func.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
import arc.struct.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
@@ -80,10 +81,13 @@ public class PlastaniumConveyor extends ArmoredConveyor{
|
|||||||
PlastaniumConveyorEntity entity = tile.ent();
|
PlastaniumConveyorEntity entity = tile.ent();
|
||||||
if(entity.reload > 0) entity.reload--;
|
if(entity.reload > 0) entity.reload--;
|
||||||
|
|
||||||
if(tile.front() == null || !(tile.front().block() instanceof PlastaniumConveyor)){
|
Tile cur = tile;
|
||||||
entity.tree = 0;
|
ObjectSet<Tile> walked = new ObjectSet<>();
|
||||||
}else{
|
entity.tree = 0;
|
||||||
entity.tree = ((PlastaniumConveyorEntity)tile.front().ent()).tree + 1;
|
while(cur.front() != null && cur.front().block() instanceof PlastaniumConveyor && !walked.contains(cur)){
|
||||||
|
walked.add(cur);
|
||||||
|
cur = cur.front();
|
||||||
|
entity.tree++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user