fix: fixed ArrayIndexOOB in getting characters

This commit is contained in:
Yannik Bretschneider 2021-06-06 21:36:29 +02:00
parent 5202b63c2e
commit 98b47ea688

View File

@ -735,7 +735,7 @@ public class GameLogic {
} }
int p1 = selectedCharacters1.size(); int p1 = selectedCharacters1.size();
int all = selectedCharacters1.size() + selectedCharacters2.size(); int all = selectedCharacters1.size() + selectedCharacters2.size() - 1; // this is the highest index + 1
ArrayList<Integer> characters = new ArrayList<>(selectedCharacters1); ArrayList<Integer> characters = new ArrayList<>(selectedCharacters1);
characters.addAll(selectedCharacters2); characters.addAll(selectedCharacters2);