From 24d1438801bedbd47eefba6f8be2edc77b902ebc Mon Sep 17 00:00:00 2001 From: no Date: Sun, 20 Jun 2021 18:37:03 +0200 Subject: [PATCH] added check for removeattackpart so that it shouldn't crash. --- src/gameplay/entities/Character.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gameplay/entities/Character.java b/src/gameplay/entities/Character.java index 75a93ae..1baf5f9 100644 --- a/src/gameplay/entities/Character.java +++ b/src/gameplay/entities/Character.java @@ -216,7 +216,7 @@ public class Character extends Entity { * which indicates the character has moved on to the next one */ public void removeFirstAttackPart() { - this.nextAttackParts.remove(0); + if(this.nextAttackParts.size() > 0) {this.nextAttackParts.remove(0);} } public ArrayList getNextThrowParts() {