mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 13:19:18 -08: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);
|
Player player = game.getPlayer(playerId);
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
int cardsInHand = player.getHand().size();
|
int cardsInHand = player.getHand().size();
|
||||||
if (cardsInHand > 1) {
|
if(cardsInHand > 0) {
|
||||||
player.discard(cardsInHand, false, false, source, game);
|
player.discard(cardsInHand, false, false, source, game);
|
||||||
cardsToDraw.put(playerId, cardsInHand - 1);
|
cardsToDraw.put(playerId, cardsInHand - 1);
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +70,7 @@ class DarkDealEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
for (Map.Entry<UUID, Integer> toDrawByPlayer : cardsToDraw.entrySet()) {
|
for (Map.Entry<UUID, Integer> toDrawByPlayer : cardsToDraw.entrySet()) {
|
||||||
Player player = game.getPlayer(toDrawByPlayer.getKey());
|
Player player = game.getPlayer(toDrawByPlayer.getKey());
|
||||||
if (player != null) {
|
if (player != null && toDrawByPlayer.getValue() > 0) {
|
||||||
player.drawCards(toDrawByPlayer.getValue(), source, game);
|
player.drawCards(toDrawByPlayer.getValue(), source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue