forked from External/mage
Narrowed variables scope.
This commit is contained in:
parent
09da478b38
commit
f1ef3bf68b
20 changed files with 42 additions and 60 deletions
|
|
@ -227,13 +227,13 @@ public class MageServerImpl implements MageServer {
|
|||
// check AI players max
|
||||
String maxAiOpponents = ConfigSettings.getInstance().getMaxAiOpponents();
|
||||
if (maxAiOpponents != null) {
|
||||
int max = Integer.parseInt(maxAiOpponents);
|
||||
int aiPlayers = 0;
|
||||
for (String playerType : options.getPlayerTypes()) {
|
||||
if (!playerType.equals("Human")) {
|
||||
aiPlayers++;
|
||||
}
|
||||
}
|
||||
int max = Integer.parseInt(maxAiOpponents);
|
||||
if (aiPlayers > max) {
|
||||
user.showUserMessage("Create tournament", "It's only allowed to use a maximum of " + max + " AI players.");
|
||||
throw new MageException("No message");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue