mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Fixed NPE on playersList usage
This commit is contained in:
parent
6fa4c0b8f2
commit
cf5b474c29
2 changed files with 2 additions and 2 deletions
|
@ -66,7 +66,7 @@ class PainsRewardEffect extends OneShotEffect {
|
|||
game.informPlayers(winner.getLogName() + " has bet " + highBid + " lifes");
|
||||
|
||||
Player currentPlayer = playerList.getNextInRange(controller, game);
|
||||
while (!Objects.equals(currentPlayer, winner)) {
|
||||
while (currentPlayer != null && !Objects.equals(currentPlayer, winner)) {
|
||||
String text = winner.getLogName() + " has bet " + highBid + " life" + (highBid > 1 ? "s" : "") + ". Top the bid?";
|
||||
if (currentPlayer.chooseUse(Outcome.Detriment, text, source, game)) {
|
||||
int newBid = currentPlayer.getAmount(highBid + 1, Integer.MAX_VALUE, "Choose amount of life to bid", game);
|
||||
|
|
|
@ -1250,7 +1250,7 @@ public class Combat implements Serializable, Copyable<Combat> {
|
|||
case RIGHT:
|
||||
players = game.getState().getPlayerList(attackingPlayerId);
|
||||
opponent = players.getPrevious(game);
|
||||
while (attackingPlayer.isInGame()) {
|
||||
while (opponent != null && attackingPlayer.isInGame()) {
|
||||
if (attackingPlayer.hasOpponent(opponent.getId(), game)) {
|
||||
attackablePlayers.add(opponent.getId());
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue