From 7d38d2b56dd413b8978681ce17cfcad0b3c0a4e1 Mon Sep 17 00:00:00 2001 From: adrivrie Date: Tue, 30 Jan 2024 21:40:11 +0100 Subject: [PATCH] Randbats Stats: Properly deal with ties --- server/chat-plugins/randombattles/winrates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/chat-plugins/randombattles/winrates.ts b/server/chat-plugins/randombattles/winrates.ts index bc33d8a5152a..55f16ad55193 100644 --- a/server/chat-plugins/randombattles/winrates.ts +++ b/server/chat-plugins/randombattles/winrates.ts @@ -167,7 +167,7 @@ async function collectStats(battle: RoomBattle, winner: ID, players: ID[]) { // may need to be raised again if doubles ladder takes off eloFloor = 1300; } - if (!formatData || battle.rated < eloFloor) return; + if (!formatData || battle.rated < eloFloor || !winner) return; checkRollover(); for (const p of battle.players) { const team = await battle.getPlayerTeam(p);