From 913ccd4de14ff7e8d5699f792a35743399426cf9 Mon Sep 17 00:00:00 2001 From: Azra Victor Date: Thu, 24 Jun 2021 12:27:39 +0200 Subject: [PATCH] changed match.nextFrame so it works properly with the new nextFrameBuffer --- src/gameplay/match/match.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index 35c0027..de57eaf 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -707,10 +707,8 @@ public class match { * @param in the input buffer corresponding to the character */ private static void nextFrame(Character c, InputBuffer in) { - try { - //if(!c.getFrames().getNextframe().equals(null)){ - c.goToNextFrames(); - } catch (NullPointerException e) { + c.goToNextFrames(); + if (c.getFrames().size() == 0) { switch(c.getStatus()) { case FALLING:case HITINAIR: if(c.getPosY() > groundLevel){ @@ -722,6 +720,15 @@ public class match { c.addNextFrames(c.getKnockedDownFrames()); } 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: c.setStatus(Status.NORMAL); if(in.getLatestInputs().containsInput(ButtonIG.DOWN)) {