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

@ -1,7 +1,7 @@
#Autogenerated file. Do not modify.
#Sun Feb 18 11:33:00 EST 2018
#Sun Feb 18 12:25:44 EST 2018
version=beta
androidBuildCode=235
androidBuildCode=236
name=Mindustry
code=3.3
build=custom build

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;
}
}