From 9294cbc3e340a4198a3e91cd6a11de03eb2e0ffc Mon Sep 17 00:00:00 2001 From: schrom01 Date: Thu, 2 Dec 2021 17:39:33 +0100 Subject: [PATCH] fix bug in switchToPreviousPlayer --- src/ch/zhaw/catan/SiedlerGame.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch/zhaw/catan/SiedlerGame.java b/src/ch/zhaw/catan/SiedlerGame.java index 2fa7aec..9041b88 100644 --- a/src/ch/zhaw/catan/SiedlerGame.java +++ b/src/ch/zhaw/catan/SiedlerGame.java @@ -58,10 +58,10 @@ public class SiedlerGame { * Switches to the next player in the defined sequence of players. */ public void switchToNextPlayer() { - if (activePlayer < allPlayers.size()){ + if (activePlayer < allPlayers.size() -1){ activePlayer++; } - else if (activePlayer == allPlayers.size()){ + else if (activePlayer == allPlayers.size() -1){ activePlayer = 0; } }