diff --git a/core/src/mindustry/world/blocks/distribution/OverflowGate.java b/core/src/mindustry/world/blocks/distribution/OverflowGate.java index f6c431cb31..9eee519386 100644 --- a/core/src/mindustry/world/blocks/distribution/OverflowGate.java +++ b/core/src/mindustry/world/blocks/distribution/OverflowGate.java @@ -69,13 +69,8 @@ public class OverflowGate extends Block{ }else if(bc && !ac){ to = b; }else{ - if(rotation == 0){ - to = a; - if(flip) rotation =1; - }else{ - to = b; - if(flip) rotation = 0; - } + to = (rotation & (1 << from)) == 0 ? a : b; + if(flip) rotation ^= (1 << from); } } diff --git a/core/src/mindustry/world/blocks/distribution/Sorter.java b/core/src/mindustry/world/blocks/distribution/Sorter.java index 3fe8653f06..4784a954b3 100644 --- a/core/src/mindustry/world/blocks/distribution/Sorter.java +++ b/core/src/mindustry/world/blocks/distribution/Sorter.java @@ -114,13 +114,8 @@ public class Sorter extends Block{ }else if(!bc){ return null; }else{ - if(rotation == 0){ - to = a; - if(flip) this.rotation = (byte)1; - }else{ - to = b; - if(flip) this.rotation = (byte)0; - } + to = (rotation & (1 << dir)) == 0 ? a : b; + if(flip) rotation ^= (1 << dir); } }