From 6643e1d08e60d8b0796ef7d703fec77ec8dc5a9b Mon Sep 17 00:00:00 2001 From: FelixKrull Date: Tue, 15 Feb 2022 13:04:38 +0100 Subject: [PATCH] Change condition of checkDice --- src/main/java/Game.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/Game.java b/src/main/java/Game.java index 9e3704a..6d843da 100644 --- a/src/main/java/Game.java +++ b/src/main/java/Game.java @@ -66,8 +66,14 @@ public class Game { * @return true if Player can roll the dice another time */ public boolean checkDice(int dice, Player p, int countRolls) { - int figuresInBase = p.checkFigureInBase(p.figures); - if(figuresInBase == 4) { + boolean figuresOnBoard = false; + for(Figure f : p.figures) { + if (f.getPosition() > -1 && f.getPosition() < 40) { + figuresOnBoard = true; + break; + } + } + if(!figuresOnBoard) { return countRolls < 3; } else return dice == 6; }