mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
hotseat: NPE fix at the beginning of 2nd match
This commit is contained in:
@@ -1488,6 +1488,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();
|
||||
return goesFirst;
|
||||
|
||||
Reference in New Issue
Block a user