Fixed teleporter loop crash

This commit is contained in:
Anuken
2018-02-18 12:26:18 -05:00
parent 39db04872c
commit fb97d00756
3 changed files with 4 additions and 7 deletions

View File

@@ -163,10 +163,6 @@ public class Conveyor extends Block{
long result = ItemPos.packItem(item, y*0.9f, pos, (byte)Mathf.random(255));
boolean inserted = false;
if(pos <= 0.00001f && entity.minitem <= 0.001f){
return; //TODO low fps stacked items: what now?
}
for(int i = 0; i < entity.convey.size; i ++){
if(compareItems(result, entity.convey.get(i)) < 0){
entity.convey.insert(i, result);

View File

@@ -47,6 +47,7 @@ public class Teleporter extends PowerBlock{
solid = true;
health = 80;
powerCapacity = 30f;
instantTransfer = true;
}
@Override
@@ -155,7 +156,7 @@ public class Teleporter extends PowerBlock{
public boolean available(Tile tile, Item item){
for(int i = 0; i < 4; i ++){
Tile next = tile.getNearby(i);
if(next != null && next.block().acceptItem(item, next, tile)){
if(next != null && !(next.block().instantTransfer) && next.block().acceptItem(item, next, tile)){
return true;
}
}