mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-02 20:33:50 +07:00
Fixed #2169
This commit is contained in:
parent
1eaa1a05ac
commit
6e162d91e5
@ -112,7 +112,7 @@ public class ItemBridge extends Block{
|
||||
return false;
|
||||
}
|
||||
|
||||
return other.block() == this && (other.team() == tile.team() || tile.block() != this) && (!checkDouble || other.<ItemBridgeEntity>ent().link != tile.pos());
|
||||
return other.block() == tile.block() && (other.team() == tile.team() || tile.block() != this) && (!checkDouble || other.<ItemBridgeEntity>ent().link != tile.pos());
|
||||
}
|
||||
|
||||
public Tile findLink(int x, int y){
|
||||
@ -280,35 +280,15 @@ public class ItemBridge extends Block{
|
||||
|
||||
if(rel == rel2) return false;
|
||||
}else{
|
||||
return source.block() instanceof ItemBridge && ((ItemBridgeEntity)source).link == tile.pos() && items.total() < itemCapacity;
|
||||
return source.block() instanceof ItemBridge && linkValid(source.tile(), tile) && items.total() < itemCapacity;
|
||||
}
|
||||
|
||||
return items.total() < itemCapacity;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canDumpLiquid(Tilec to, Liquid liquid){
|
||||
Tile other = world.tile(link);
|
||||
if(!linkValid(tile, other)){
|
||||
Tile edge = Edges.getFacingEdge(to.tile(), tile);
|
||||
int i = relativeTo(edge.x, edge.y);
|
||||
|
||||
IntSetIterator it = incoming.iterator();
|
||||
|
||||
while(it.hasNext){
|
||||
int v = it.next();
|
||||
if(relativeTo(Point2.x(v), Point2.y(v)) == i){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int rel = relativeTo(other.x, other.y);
|
||||
int rel2 = relativeTo(to.tileX(), to.tileY());
|
||||
|
||||
return rel != rel2;
|
||||
return checkDump(to);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -322,7 +302,7 @@ public class ItemBridge extends Block{
|
||||
int rel2 = relativeTo(Edges.getFacingEdge(source, this));
|
||||
|
||||
if(rel == rel2) return false;
|
||||
}else if(!(source.block() instanceof ItemBridge && ((ItemBridgeEntity)source).link == tile.pos())){
|
||||
}else if(!(source.block() instanceof ItemBridge && linkValid(source.tile(), tile))){
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -331,6 +311,10 @@ public class ItemBridge extends Block{
|
||||
|
||||
@Override
|
||||
public boolean canDump(Tilec to, Item item){
|
||||
return checkDump(to);
|
||||
}
|
||||
|
||||
protected boolean checkDump(Tilec to){
|
||||
Tile other = world.tile(link);
|
||||
if(!linkValid(tile, other)){
|
||||
Tile edge = Edges.getFacingEdge(to.tile(), tile);
|
||||
|
Loading…
Reference in New Issue
Block a user