Direction bugfixes
This commit is contained in:
@@ -189,6 +189,10 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
|
|||||||
return relativeTo(tile.tile());
|
return relativeTo(tile.tile());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public byte relativeToEdge(Tile other){
|
||||||
|
return relativeTo(Edges.getFacingEdge(other, tile));
|
||||||
|
}
|
||||||
|
|
||||||
public byte relativeTo(int cx, int cy){
|
public byte relativeTo(int cx, int cy){
|
||||||
return tile.absoluteRelativeTo(cx, cy);
|
return tile.absoluteRelativeTo(cx, cy);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class OverflowGate extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable Tilec getTileTarget(Item item, Tile src, boolean flip){
|
public @Nullable Tilec getTileTarget(Item item, Tile src, boolean flip){
|
||||||
int from = relativeTo(src.x, src.y);
|
int from = relativeToEdge(src);
|
||||||
if(from == -1) return null;
|
if(from == -1) return null;
|
||||||
Tilec to = nearby((from + 2) % 4);
|
Tilec to = nearby((from + 2) % 4);
|
||||||
boolean canForward = to != null && to.acceptItem(this, item) && to.team() == team && !(to.block() instanceof OverflowGate);
|
boolean canForward = to != null && to.acceptItem(this, item) && to.team() == team && !(to.block() instanceof OverflowGate);
|
||||||
|
|||||||
Reference in New Issue
Block a user