Minor bridge linking fix
This commit is contained in:
@@ -1585,7 +1585,7 @@ lenum.sin = Sine, in degrees.
|
|||||||
lenum.cos = Cosine, in degrees.
|
lenum.cos = Cosine, in degrees.
|
||||||
lenum.tan = Tangent, in degrees.
|
lenum.tan = Tangent, in degrees.
|
||||||
#not a typo, look up 'range notation'
|
#not a typo, look up 'range notation'
|
||||||
lenum.rand = Random number in range [0, value).
|
lenum.rand = Random decimal in range [0, value).
|
||||||
lenum.log = Natural logarithm (ln).
|
lenum.log = Natural logarithm (ln).
|
||||||
lenum.log10 = Base 10 logarithm.
|
lenum.log10 = Base 10 logarithm.
|
||||||
lenum.noise = 2D simplex noise.
|
lenum.noise = 2D simplex noise.
|
||||||
|
|||||||
@@ -859,6 +859,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
req.animScale = 1f;
|
req.animScale = 1f;
|
||||||
lineRequests.add(req);
|
lineRequests.add(req);
|
||||||
});
|
});
|
||||||
|
block.handlePlacementLine(lineRequests);
|
||||||
|
|
||||||
if(Core.settings.getBool("blockreplace")){
|
if(Core.settings.getBool("blockreplace")){
|
||||||
lineRequests.each(req -> {
|
lineRequests.each(req -> {
|
||||||
|
|||||||
@@ -12,16 +12,16 @@ import mindustry.world.blocks.distribution.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class Placement{
|
public class Placement{
|
||||||
private final static Seq<Point2> tmpPoints = new Seq<>(), tmpPoints2 = new Seq<>();
|
private static final Seq<Point2> tmpPoints = new Seq<>(), tmpPoints2 = new Seq<>();
|
||||||
private static final NormalizeResult result = new NormalizeResult();
|
private static final NormalizeResult result = new NormalizeResult();
|
||||||
private static final NormalizeDrawResult drawResult = new NormalizeDrawResult();
|
private static final NormalizeDrawResult drawResult = new NormalizeDrawResult();
|
||||||
private static Bresenham2 bres = new Bresenham2();
|
private static final Bresenham2 bres = new Bresenham2();
|
||||||
private static Seq<Point2> points = new Seq<>();
|
private static final Seq<Point2> points = new Seq<>();
|
||||||
|
|
||||||
//for pathfinding
|
//for pathfinding
|
||||||
private static IntFloatMap costs = new IntFloatMap();
|
private static final IntFloatMap costs = new IntFloatMap();
|
||||||
private static IntIntMap parents = new IntIntMap();
|
private static final IntIntMap parents = new IntIntMap();
|
||||||
private static IntSet closed = new IntSet();
|
private static final IntSet closed = new IntSet();
|
||||||
|
|
||||||
/** Normalize a diagonal line into points. */
|
/** Normalize a diagonal line into points. */
|
||||||
public static Seq<Point2> pathfindLine(boolean conveyors, int startX, int startY, int endX, int endY){
|
public static Seq<Point2> pathfindLine(boolean conveyors, int startX, int startY, int endX, int endY){
|
||||||
|
|||||||
@@ -403,6 +403,11 @@ public class Block extends UnlockableContent{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Mutates the given list of requests used during line placement. */
|
||||||
|
public void handlePlacementLine(Seq<BuildPlan> plans){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public Object nextConfig(){
|
public Object nextConfig(){
|
||||||
if(saveConfig && lastConfig != null){
|
if(saveConfig && lastConfig != null){
|
||||||
return lastConfig;
|
return lastConfig;
|
||||||
|
|||||||
@@ -176,11 +176,11 @@ public class ItemBridge extends Block{
|
|||||||
public void playerPlaced(Object config){
|
public void playerPlaced(Object config){
|
||||||
super.playerPlaced(config);
|
super.playerPlaced(config);
|
||||||
|
|
||||||
if(config != null) return;
|
if(config == null){
|
||||||
|
Tile link = findLink(tile.x, tile.y);
|
||||||
Tile link = findLink(tile.x, tile.y);
|
if(linkValid(tile, link) && !proximity.contains(link.build)){
|
||||||
if(linkValid(tile, link) && !proximity.contains(link.build)){
|
link.build.configure(tile.pos());
|
||||||
link.build.configure(tile.pos());
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lastBuild = this;
|
lastBuild = this;
|
||||||
|
|||||||
Reference in New Issue
Block a user