Made junction ignore clogs
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Sat Apr 14 20:43:56 EDT 2018
|
#Sat Apr 14 21:55:24 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=513
|
androidBuildCode=514
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.5
|
code=3.5
|
||||||
build=custom build
|
build=custom build
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public class Junction extends Block{
|
|||||||
|
|
||||||
for(int i = 0; i < 2; i ++){
|
for(int i = 0; i < 2; i ++){
|
||||||
Buffer buffer = (i == 0 ? entity.bx : entity.by);
|
Buffer buffer = (i == 0 ? entity.bx : entity.by);
|
||||||
|
|
||||||
if(buffer.index > 0){
|
if(buffer.index > 0){
|
||||||
if(buffer.index > buffer.items.length) buffer.index = buffer.items.length;
|
if(buffer.index > buffer.items.length) buffer.index = buffer.items.length;
|
||||||
long l = buffer.items[0];
|
long l = buffer.items[0];
|
||||||
@@ -45,7 +46,13 @@ public class Junction extends Block{
|
|||||||
int direction = Bits.getRightShort(val);
|
int direction = Bits.getRightShort(val);
|
||||||
Tile dest = tile.getNearby(direction);
|
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);
|
dest.block().handleItem(item, dest, tile);
|
||||||
System.arraycopy(buffer.items, 1, buffer.items, 0, buffer.index - 1);
|
System.arraycopy(buffer.items, 1, buffer.items, 0, buffer.index - 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user