SteamWar/BungeeCore
Archiviert
13
2

Fix emblem not being the highest
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-03-15 13:23:37 +01:00
Ursprung 527576aa14
Commit 6f5a3c352f

Datei anzeigen

@ -107,6 +107,8 @@ public class UserElo {
return emblemCache.get(user.getId());
}
int maxEmblemProgression = 0;
int maxEloOfGameMode = 0;
int maxEloOfPlayer = 0;
ArenaMode arenaMode = null;
for (ArenaMode mode : ArenaMode.getAllModes()) {
@ -114,17 +116,22 @@ public class UserElo {
if (UserElo.getFightsOfSeason(user.getId(), mode.getSchemType()) < 10) continue;
Optional<Integer> currentElo = UserElo.getElo(user.getId(), mode.getSchemType());
if (currentElo.isPresent() && currentElo.get() > maxEloOfPlayer) {
if (currentElo.isPresent()) {
int currentMaxEloOfGameMode = UserElo.getMaxElo(mode.getSchemType());
int progression = getProgression(currentElo.get(), currentMaxEloOfGameMode);
if (progression > maxEmblemProgression) {
maxEmblemProgression = progression;
maxEloOfGameMode = currentMaxEloOfGameMode;
maxEloOfPlayer = currentElo.get();
arenaMode = mode;
}
}
}
if (arenaMode == null) {
emblemCache.put(user.getId(), "");
return "";
}
int maxEloOfGameMode = UserElo.getMaxElo(arenaMode.getSchemType());
String emblem = getEmblem(maxEloOfPlayer, maxEloOfGameMode);
emblemCache.put(user.getId(), emblem);
return emblem;