mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-25 22:58:47 +07:00
Bugfixes / Better power link priority
This commit is contained in:
parent
b542b6651e
commit
08d0a7ada7
@ -434,6 +434,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
public void useSchematic(Schematic schem){
|
||||
selectRequests.clear();
|
||||
selectRequests.addAll(schematics.toRequests(schem, world.toTile(player.x), world.toTile(player.y)));
|
||||
lastSchematic = schem;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -114,7 +114,11 @@ public class PowerNode extends PowerBlock{
|
||||
}
|
||||
});
|
||||
|
||||
tempTiles.sort(Structs.comparingFloat(t -> t.dst2(tile)));
|
||||
tempTiles.sort((a, b) -> {
|
||||
int type = -Boolean.compare(a.block() instanceof PowerNode, b.block() instanceof PowerNode);
|
||||
if(type != 0) return type;
|
||||
return Float.compare(a.dst2(tile), b.dst2(tile));
|
||||
});
|
||||
tempTiles.each(valid, other -> {
|
||||
if(!tile.entity.power.links.contains(other.pos())){
|
||||
tile.configureAny(other.pos());
|
||||
@ -139,7 +143,11 @@ public class PowerNode extends PowerBlock{
|
||||
}
|
||||
});
|
||||
|
||||
tempTiles.sort(Structs.comparingFloat(t -> t.dst2(tile)));
|
||||
tempTiles.sort((a, b) -> {
|
||||
int type = -Boolean.compare(a.block() instanceof PowerNode, b.block() instanceof PowerNode);
|
||||
if(type != 0) return type;
|
||||
return Float.compare(a.dst2(tile), b.dst2(tile));
|
||||
});
|
||||
tempTiles.each(valid, t -> {
|
||||
graphs.add(t.entity.power.graph);
|
||||
others.get(t);
|
||||
|
Loading…
Reference in New Issue
Block a user