Made junction ignore clogs

This commit is contained in:
Anuken
2018-04-14 21:57:10 -04:00
parent cce4113b2d
commit 02ab945ab8
2 changed files with 10 additions and 3 deletions

View File

@ -1,7 +1,7 @@
#Autogenerated file. Do not modify.
#Sat Apr 14 20:43:56 EDT 2018
#Sat Apr 14 21:55:24 EDT 2018
version=release
androidBuildCode=513
androidBuildCode=514
name=Mindustry
code=3.5
build=custom build

View File

@ -32,6 +32,7 @@ public class Junction extends Block{
for(int i = 0; i < 2; i ++){
Buffer buffer = (i == 0 ? entity.bx : entity.by);
if(buffer.index > 0){
if(buffer.index > buffer.items.length) buffer.index = buffer.items.length;
long l = buffer.items[0];
@ -45,7 +46,13 @@ public class Junction extends Block{
int direction = Bits.getRightShort(val);
Tile dest = tile.getNearby(direction);
if(dest == null || !dest.block().acceptItem(item, dest, tile)) continue;
if(dest == null || !dest.block().acceptItem(item, dest, tile)){
if(buffer.index > 1){
System.arraycopy(buffer.items, 1, buffer.items, 0, buffer.index - 1);
buffer.index --;
}
continue;
}
dest.block().handleItem(item, dest, tile);
System.arraycopy(buffer.items, 1, buffer.items, 0, buffer.index - 1);