hotseat: NPE fix at the beginning of 2nd match

This commit is contained in:
Maxmtg
2013-06-29 20:27:17 +00:00
parent 7101dc02c4
commit e1fb9121af

View File

@@ -1487,6 +1487,12 @@ public class GameAction {
}
}
}
if ( goesFirst == null ) {
// This happens in hotseat matches when 2 equal lobbyplayers play.
// Noone of them has lost, so cannot decide who goes first .
goesFirst = game.getPlayers().get(0); // does not really matter who plays first - it's controlled from the same computer.
}
boolean willPlay = goesFirst.getController().getWillPlayOnFirstTurn(isFirstGame);
goesFirst = willPlay ? goesFirst : goesFirst.getOpponent();