Skip to content

Commit

Permalink
this is nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisSoemers committed May 15, 2020
1 parent 6101867 commit 50f7b91
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/random/RandomAI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.concurrent.ThreadLocalRandom;

import game.Game;
import game.types.GameType;
import main.collections.FastArrayList;
import util.AI;
import util.Context;
Expand Down Expand Up @@ -54,7 +53,7 @@ public RandomAI()

// If we're playing a simultaneous-move game, some of the legal moves may be
// for different players. Extract only the ones that we can choose.
if ((game.stateFlags() & GameType.Simultaneous) != 0L)
if (!game.isAlternatingMoveGame())
legalMoves = AIUtils.extractMovesForMover(legalMoves, player);

final int r = ThreadLocalRandom.current().nextInt(legalMoves.size());
Expand Down

0 comments on commit 50f7b91

Please sign in to comment.