Fix crash when fed directly by a conveyor

This commit is contained in:
Patrick 'Quezler' Mounier
2019-12-29 20:49:06 +01:00
parent 899137fbf7
commit d99f163cac
2 changed files with 3 additions and 3 deletions

View File

@@ -116,7 +116,7 @@ public class CompressedConveyor extends ArmoredConveyor{
public void handleStack(Item item, int amount, Tile tile, Unit source){
//
}
@Override
public boolean blendsArmored(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){
return super.blendsArmored(tile, rotation, otherx, othery, otherrot, otherblock) && otherblock.compressable;

View File

@@ -183,7 +183,7 @@ public class Conveyor extends Block implements Autotiler{
Tile next = tile.getNearby(tile.rotation());
if(next != null) next = next.link();
float nextMax = next != null && next.block() instanceof Conveyor && next.block().acceptItem(null, next, tile) ? 1f - Math.max(itemSpace - next.<ConveyorEntity>ent().minitem, 0) : 1f;
float nextMax = next != null && next.block() instanceof Conveyor && !next.block().compressable && next.block().acceptItem(null, next, tile) ? 1f - Math.max(itemSpace - next.<ConveyorEntity>ent().minitem, 0) : 1f;
int minremove = Integer.MAX_VALUE;
for(int i = entity.convey.size - 1; i >= 0; i--){
@@ -210,7 +210,7 @@ public class Conveyor extends Block implements Autotiler{
pos.y = Mathf.clamp(pos.y, 0, nextMax);
if(pos.y >= 0.9999f && offloadDir(tile, pos.item)){
if(next != null && next.block() instanceof Conveyor){
if(next != null && next.block() instanceof Conveyor && !next.block().compressable){
ConveyorEntity othere = next.ent();
ItemPos ni = pos2.set(othere.convey.get(othere.lastInserted), ItemPos.updateShorts);