Fixed a problem with AI opponent selection,

This commit is contained in:
LevelX2 2017-11-25 12:55:26 +01:00
parent 72cadf286c
commit 603e625d8d

View file

@ -2250,7 +2250,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
* @return * @return
*/ */
private UUID getRandomOpponent(UUID abilityControllerId, Game game) { private UUID getRandomOpponent(UUID abilityControllerId, Game game) {
UUID randomOpponentId = game.getOpponents(abilityControllerId).iterator().next(); UUID randomOpponentId = null;
Set<UUID> opponents = game.getOpponents(abilityControllerId); Set<UUID> opponents = game.getOpponents(abilityControllerId);
if (opponents.size() > 1) { if (opponents.size() > 1) {
int rand = RandomUtil.nextInt(opponents.size()); int rand = RandomUtil.nextInt(opponents.size());