From ef320718ef6b5493f049d26a02e3559aaeaf2b9e Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 11 Mar 2022 20:14:39 +0100 Subject: [PATCH] Update FightEndsHandler --- .../bungeecore/comms/handlers/FightEndsHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/comms/handlers/FightEndsHandler.java b/src/de/steamwar/bungeecore/comms/handlers/FightEndsHandler.java index 97e263c0..50afa5df 100644 --- a/src/de/steamwar/bungeecore/comms/handlers/FightEndsHandler.java +++ b/src/de/steamwar/bungeecore/comms/handlers/FightEndsHandler.java @@ -73,9 +73,9 @@ public class FightEndsHandler implements SpigotHandler { calculateEloOfTeam(fightEndsPacket.getRedSchem(), redSchemElo, blueSchemElo, 1 - blueResult, fightEndsPacket.getRedPlayers(), fightEndsPacket.getGameMode()); } - private void calculateEloOfTeam(int schemId, int elo1, int elo2, double result, List players, String gameMode) { - double winExpectation = 1 / (1 + Math.pow(10, (elo1 - elo2) / 600f)); - SchemElo.setElo(schemId, (int) Math.round(elo1 + K * (result - winExpectation))); + private void calculateEloOfTeam(int schemId, int eloOwn, int eloEnemy, double result, List players, String gameMode) { + double winExpectation = 1 / (1 + Math.pow(10, (eloOwn - eloEnemy) / 600f)); + SchemElo.setElo(schemId, (int) Math.round(eloOwn + K * (result - winExpectation))); for (int player : players) { int playerElo = UserElo.getEloOrDefault(player, gameMode); UserElo.setElo(player, gameMode, (int) Math.round(playerElo + K * (result - winExpectation)));