Narrowed variables scope.

This commit is contained in:
vraskulin 2017-02-15 16:05:18 +03:00
parent 09da478b38
commit f1ef3bf68b
20 changed files with 42 additions and 60 deletions

View file

@ -911,9 +911,6 @@ public class TableController {
public boolean isMatchTableStillValid() {
// check only normal match table with state != Finished
if (!table.isTournament()) {
int humanPlayers = 0;
int aiPlayers = 0;
int validHumanPlayers = 0;
if (!(table.getState() == TableState.WAITING || table.getState() == TableState.STARTING || table.getState() == TableState.READY_TO_START)) {
if (match == null) {
logger.debug("- Match table with no match:");
@ -927,6 +924,9 @@ public class TableController {
}
}
// check for active players
int validHumanPlayers = 0;
int aiPlayers = 0;
int humanPlayers = 0;
for (Map.Entry<UUID, UUID> userPlayerEntry : userPlayerMap.entrySet()) {
MatchPlayer matchPlayer = match.getPlayer(userPlayerEntry.getValue());
if (matchPlayer == null) {