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