mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
add checks to Player::millCards to prevent anything from happening if the amount isn't positive
This commit is contained in:
parent
37b8e09200
commit
5d58958139
1 changed files with 4 additions and 1 deletions
|
|
@ -5328,8 +5328,11 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
|
||||
@Override
|
||||
public Cards millCards(int toMill, Ability source, Game game) {
|
||||
if (toMill < 1) {
|
||||
return new CardsImpl();
|
||||
}
|
||||
GameEvent event = GameEvent.getEvent(GameEvent.EventType.MILL_CARDS, getId(), source, getId(), toMill);
|
||||
if (game.replaceEvent(event)) {
|
||||
if (game.replaceEvent(event) || event.getAmount() < 1) {
|
||||
return new CardsImpl();
|
||||
}
|
||||
Cards cards = new CardsImpl(this.getLibrary().getTopCards(game, event.getAmount()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue