From a2dafd7a1af8e140ec0ea1882d0b82ada5d295d6 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 15 Nov 2022 18:09:52 +0100 Subject: [PATCH] Hotfix RandomPlayerScript --- .../misslewars/scripts/implemented/RandomPlayerScript.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/misslewars/scripts/implemented/RandomPlayerScript.java b/src/de/steamwar/misslewars/scripts/implemented/RandomPlayerScript.java index 9cebebf..240c5a2 100644 --- a/src/de/steamwar/misslewars/scripts/implemented/RandomPlayerScript.java +++ b/src/de/steamwar/misslewars/scripts/implemented/RandomPlayerScript.java @@ -42,7 +42,7 @@ public class RandomPlayerScript implements RunnableScript { if (size == 0) return true; int index = random.nextInt(size); Player player; - if (index > MissileWars.getBlueTeam().getPlayers().size()) { + if (index >= MissileWars.getBlueTeam().getPlayers().size()) { player = MissileWars.getRedTeam().getPlayers().get(index - MissileWars.getBlueTeam().getPlayers().size()); } else { player = MissileWars.getBlueTeam().getPlayers().get(index);