mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-12 19:09:34 +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 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){
|
public Tile findLink(int x, int y){
|
||||||
@ -280,35 +280,15 @@ public class ItemBridge extends Block{
|
|||||||
|
|
||||||
if(rel == rel2) return false;
|
if(rel == rel2) return false;
|
||||||
}else{
|
}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;
|
return items.total() < itemCapacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDumpLiquid(Tilec to, Liquid liquid){
|
public boolean canDumpLiquid(Tilec to, Liquid liquid){
|
||||||
Tile other = world.tile(link);
|
return checkDump(to);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -322,7 +302,7 @@ public class ItemBridge extends Block{
|
|||||||
int rel2 = relativeTo(Edges.getFacingEdge(source, this));
|
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 && linkValid(source.tile(), tile))){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,6 +311,10 @@ public class ItemBridge extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDump(Tilec to, Item item){
|
public boolean canDump(Tilec to, Item item){
|
||||||
|
return checkDump(to);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean checkDump(Tilec to){
|
||||||
Tile other = world.tile(link);
|
Tile other = world.tile(link);
|
||||||
if(!linkValid(tile, other)){
|
if(!linkValid(tile, other)){
|
||||||
Tile edge = Edges.getFacingEdge(to.tile(), tile);
|
Tile edge = Edges.getFacingEdge(to.tile(), tile);
|
||||||
|
Loading…
Reference in New Issue
Block a user