changed match.nextFrame so it works properly with the new nextFrameBuffer

This commit is contained in:
Azra Victor 2021-06-24 12:27:39 +02:00 committed by no
parent 9a8e13bfb5
commit 913ccd4de1

View File

@ -707,10 +707,8 @@ public class match {
* @param in the input buffer corresponding to the character * @param in the input buffer corresponding to the character
*/ */
private static void nextFrame(Character c, InputBuffer in) { private static void nextFrame(Character c, InputBuffer in) {
try { c.goToNextFrames();
//if(!c.getFrames().getNextframe().equals(null)){ if (c.getFrames().size() == 0) {
c.goToNextFrames();
} catch (NullPointerException e) {
switch(c.getStatus()) { switch(c.getStatus()) {
case FALLING:case HITINAIR: case FALLING:case HITINAIR:
if(c.getPosY() > groundLevel){ if(c.getPosY() > groundLevel){
@ -722,6 +720,15 @@ public class match {
c.addNextFrames(c.getKnockedDownFrames()); c.addNextFrames(c.getKnockedDownFrames());
} }
break; break;
case JUMPING:
if(c.getPosY() > groundLevel) {
c.setCurrentFrame(c.getNeutralJump().getFrame().get(c.getNeutralJump().getFrame().size() - 1));
} else {
c.setPos(c.getPosX(),groundLevel);
c.setStatus(Status.NORMAL);
c.addNextFrames(c.getDefaultStandingFrames());
}
break;
default: default:
c.setStatus(Status.NORMAL); c.setStatus(Status.NORMAL);
if(in.getLatestInputs().containsInput(ButtonIG.DOWN)) { if(in.getLatestInputs().containsInput(ButtonIG.DOWN)) {