Edge tweaks
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package mindustry.world;
|
||||
|
||||
import arc.math.Mathf;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.*;
|
||||
|
||||
import static mindustry.Vars.world;
|
||||
|
||||
@@ -49,6 +50,10 @@ public class Edges{
|
||||
}
|
||||
}
|
||||
|
||||
public static Tile getFacingEdge(Tilec tile, Tilec other){
|
||||
return getFacingEdge(tile.block(), tile.tileX(), tile.tileY(), other.tile());
|
||||
}
|
||||
|
||||
public static Tile getFacingEdge(Tile tile, Tile other){
|
||||
return getFacingEdge(tile.block, tile.x, tile.y, other);
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ public class ItemBridge extends Block{
|
||||
|
||||
if(linkValid(tile, other)){
|
||||
int rel = relativeTo(other);
|
||||
int rel2 = relativeTo(Edges.getFacingEdge(source.tile(), tile));
|
||||
int rel2 = relativeTo(Edges.getFacingEdge(source, this));
|
||||
|
||||
if(rel == rel2) return false;
|
||||
}else{
|
||||
@@ -319,7 +319,7 @@ public class ItemBridge extends Block{
|
||||
|
||||
if(linkValid(tile, other)){
|
||||
int rel = relativeTo(other.x, other.y);
|
||||
int rel2 = relativeTo(source.tileX(), source.tileY());
|
||||
int rel2 = relativeTo(Edges.getFacingEdge(source, this));
|
||||
|
||||
if(rel == rel2) return false;
|
||||
}else if(!(source.block() instanceof ItemBridge && ((ItemBridgeEntity)source).link == tile.pos())){
|
||||
|
||||
Reference in New Issue
Block a user