mirror of
https://github.com/correl/mage.git
synced 2025-04-11 09:11:12 -09:00
Removed erroneous check in dark deal effect (#10265)
* Removed erroneous check in dark deal effect * Fixed NPE with empty hand in dark deal
This commit is contained in:
parent
e176292da6
commit
ed32ee554d
1 changed files with 2 additions and 2 deletions
|
@ -62,7 +62,7 @@ class DarkDealEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
int cardsInHand = player.getHand().size();
|
||||
if (cardsInHand > 1) {
|
||||
if(cardsInHand > 0) {
|
||||
player.discard(cardsInHand, false, false, source, game);
|
||||
cardsToDraw.put(playerId, cardsInHand - 1);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ class DarkDealEffect extends OneShotEffect {
|
|||
}
|
||||
for (Map.Entry<UUID, Integer> toDrawByPlayer : cardsToDraw.entrySet()) {
|
||||
Player player = game.getPlayer(toDrawByPlayer.getKey());
|
||||
if (player != null) {
|
||||
if (player != null && toDrawByPlayer.getValue() > 0) {
|
||||
player.drawCards(toDrawByPlayer.getValue(), source, game);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue