Fixed puddles not appearing / Overdrive tweaks

- Bridges, routers and junctions can (probably) be overdrived now, untested
This commit is contained in:
Anuken
2020-05-08 16:41:59 -04:00
parent bcec6261d1
commit aab97fefc8
18 changed files with 58 additions and 90 deletions

View File

@@ -7,14 +7,11 @@ import mindustry.type.*;
import static mindustry.Vars.content;
public class ItemBuffer{
private final float speed;
private long[] buffer;
private int index;
public ItemBuffer(int capacity, float speed){
public ItemBuffer(int capacity){
this.buffer = new long[capacity];
this.speed = speed;
}
public boolean accepts(){
@@ -30,7 +27,7 @@ public class ItemBuffer{
accept(item, (short)-1);
}
public Item poll(){
public Item poll(float speed){
if(index > 0){
long l = buffer[0];
float time = Float.intBitsToFloat(Pack.leftInt(l));
@@ -42,18 +39,6 @@ public class ItemBuffer{
return null;
}
public short pollData(){
if(index > 0){
long l = buffer[0];
float time = Float.intBitsToFloat(Pack.leftInt(l));
if(Time.time() >= time + speed || Time.time() < time){
return Pack.rightShort(Pack.rightInt(l));
}
}
return -1;
}
public void remove(){
System.arraycopy(buffer, 1, buffer, 0, index - 1);
index--;