mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-09 20:29:06 +07:00
Less instant transfer block chaining
This commit is contained in:
parent
00f7f57c46
commit
ec2593f3d5
@ -21,6 +21,7 @@ public class OverflowGate extends Block{
|
||||
solid = true;
|
||||
update = true;
|
||||
group = BlockGroup.transportation;
|
||||
instantTransfer = true;
|
||||
unloadable = false;
|
||||
canOverdrive = false;
|
||||
}
|
||||
@ -92,12 +93,11 @@ public class OverflowGate extends Block{
|
||||
Building to = nearby((from + 2) % 4);
|
||||
boolean canForward = to != null && to.acceptItem(this, item) && to.team() == team && !(to.block() instanceof OverflowGate);
|
||||
|
||||
|
||||
if(!canForward || invert){
|
||||
Building a = nearby(Mathf.mod(from - 1, 4));
|
||||
Building b = nearby(Mathf.mod(from + 1, 4));
|
||||
boolean ac = a != null && a.acceptItem(this, item) && !(a.block() instanceof OverflowGate) && a.team() == team;
|
||||
boolean bc = b != null && b.acceptItem(this, item) && !(b.block() instanceof OverflowGate) && b.team() == team;
|
||||
boolean ac = a != null && a.acceptItem(this, item) && !(a.block() instanceof OverflowGate) && a.team == team;
|
||||
boolean bc = b != null && b.acceptItem(this, item) && !(b.block() instanceof OverflowGate) && b.team == team;
|
||||
|
||||
if(!ac && !bc){
|
||||
return invert && canForward ? to : null;
|
||||
|
@ -88,7 +88,7 @@ public class Sorter extends Block{
|
||||
|
||||
public boolean isSame(Building other){
|
||||
// comment code below to allow sorter/gate chaining
|
||||
return other != null && (other.block() instanceof Sorter || other.block() instanceof OverflowGate);
|
||||
return other != null && other.block().instantTransfer;
|
||||
}
|
||||
|
||||
public Building getTileTarget(Item item, Building source, boolean flip){
|
||||
|
Loading…
Reference in New Issue
Block a user