From ec2593f3d5846dea667ba91bbbf884af84e1e009 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 18 Aug 2020 10:17:07 -0400 Subject: [PATCH] Less instant transfer block chaining --- .../mindustry/world/blocks/distribution/OverflowGate.java | 6 +++--- core/src/mindustry/world/blocks/distribution/Sorter.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/world/blocks/distribution/OverflowGate.java b/core/src/mindustry/world/blocks/distribution/OverflowGate.java index abe189a093..bbd11bd8c3 100644 --- a/core/src/mindustry/world/blocks/distribution/OverflowGate.java +++ b/core/src/mindustry/world/blocks/distribution/OverflowGate.java @@ -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; diff --git a/core/src/mindustry/world/blocks/distribution/Sorter.java b/core/src/mindustry/world/blocks/distribution/Sorter.java index d22c5340cc..c94f206af4 100644 --- a/core/src/mindustry/world/blocks/distribution/Sorter.java +++ b/core/src/mindustry/world/blocks/distribution/Sorter.java @@ -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){