13
0

Merge pull request 'Fix Leaderboard IndexOutOfBoundsException' (#33) from leaderboard_ioobe into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #33
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2023-04-19 22:24:39 +02:00
Commit dadf78f126

Datei anzeigen

@ -37,6 +37,7 @@ public class Leaderboard {
entities.forEach(REntity::die); entities.forEach(REntity::die);
entities.clear(); entities.clear();
List<LeaderboardEntry> leaderboard = getLeaderboard(); List<LeaderboardEntry> leaderboard = getLeaderboard();
if (leaderboard.isEmpty()) return;
long bestTime = leaderboard.get(0).time; long bestTime = leaderboard.get(0).time;
for (int i = 0; i <= best; i++) { for (int i = 0; i <= best; i++) {
if (best - i >= leaderboard.size()) continue; if (best - i >= leaderboard.size()) continue;