mirror of
https://github.com/correl/mage.git
synced 2024-12-25 19:25:41 +00:00
Fixed possible NPE during handling of choosing start player (Fixes #317).
This commit is contained in:
parent
8b67be6e65
commit
c6e4df60ba
1 changed files with 8 additions and 9 deletions
|
@ -624,22 +624,21 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
|||
TargetPlayer targetPlayer = new TargetPlayer();
|
||||
targetPlayer.setRequired(true);
|
||||
targetPlayer.setTargetName("starting player");
|
||||
Player choosingPlayer;
|
||||
if (choosingPlayerId == null) {
|
||||
choosingPlayer = getPlayer(pickChoosingPlayer());
|
||||
}
|
||||
else {
|
||||
Player choosingPlayer = null;
|
||||
if (choosingPlayerId != null) {
|
||||
choosingPlayer = this.getPlayer(choosingPlayerId);
|
||||
}
|
||||
if (choosingPlayer.choose(Outcome.Benefit, targetPlayer, null, this)) {
|
||||
if (choosingPlayer == null) {
|
||||
choosingPlayer = getPlayer(pickChoosingPlayer());
|
||||
}
|
||||
if (choosingPlayer != null && choosingPlayer.choose(Outcome.Benefit, targetPlayer, null, this)) {
|
||||
startingPlayerId = ((List<UUID>)targetPlayer.getTargets()).get(0);
|
||||
fireInformEvent(state.getPlayer(startingPlayerId).getName() + " will start");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// not possible to choose starting player, stop here
|
||||
return;
|
||||
}
|
||||
|
||||
//saveState();
|
||||
|
||||
//20091005 - 103.3
|
||||
for (UUID playerId: state.getPlayerList(startingPlayerId)) {
|
||||
|
|
Loading…
Reference in a new issue