small error corrections

This commit is contained in:
Azra Victor 2021-06-10 14:06:15 +02:00 committed by no
parent 4ad12a3a59
commit ea4762c50e
2 changed files with 8 additions and 3 deletions

View File

@ -40,8 +40,13 @@ public class nextFrameBuffer {
}
public void goToNext() {
this.current = this.next.current;
this.next = this.next.next;
try {
this.current = this.next.current;
this.next = this.next.next;
} catch (NullPointerException n) {
this.setCurrentFrame(null);
this.setNext(new nextFrameBuffer());
}
}
public Frame getCurrentFrame() {

View File

@ -112,7 +112,7 @@ public class InputBuffer {
} catch (ArrayIndexOutOfBoundsException e ) {
return true;
}
for(int i = command.length - 2; i <= 0 && ret; i--) {
for(int i = command.length - 2; i >= 0 && ret; i--) {
backCounter = 1;
if(startFrameCount - backCounter < 0) {frameToCheck = this.size - (backCounter - startFrameCount);}
else {frameToCheck = startFrameCount - backCounter;}