mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-13 12:16:53 +07:00
Edge tweaks
This commit is contained in:
parent
381df23bf2
commit
1cefaf28db
@ -1,9 +1,10 @@
|
|||||||
package mindustry.world;
|
package mindustry.world;
|
||||||
|
|
||||||
import arc.math.Mathf;
|
import arc.math.*;
|
||||||
import arc.math.geom.*;
|
import arc.math.geom.*;
|
||||||
|
import mindustry.gen.*;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
|
|
||||||
import static mindustry.Vars.world;
|
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){
|
public static Tile getFacingEdge(Tile tile, Tile other){
|
||||||
return getFacingEdge(tile.block, tile.x, tile.y, other);
|
return getFacingEdge(tile.block, tile.x, tile.y, other);
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ public class ItemBridge extends Block{
|
|||||||
|
|
||||||
if(linkValid(tile, other)){
|
if(linkValid(tile, other)){
|
||||||
int rel = relativeTo(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;
|
if(rel == rel2) return false;
|
||||||
}else{
|
}else{
|
||||||
@ -319,7 +319,7 @@ public class ItemBridge extends Block{
|
|||||||
|
|
||||||
if(linkValid(tile, other)){
|
if(linkValid(tile, other)){
|
||||||
int rel = relativeTo(other.x, other.y);
|
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;
|
if(rel == rel2) return false;
|
||||||
}else if(!(source.block() instanceof ItemBridge && ((ItemBridgeEntity)source).link == tile.pos())){
|
}else if(!(source.block() instanceof ItemBridge && ((ItemBridgeEntity)source).link == tile.pos())){
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=45377e8f7daca3299262a92d387a0d12fc612e12
|
archash=811e22ca49b8e5ad1cffb36a74199c1bec73ee87
|
||||||
|
Loading…
Reference in New Issue
Block a user