Skip to content

Commit

Permalink
return false early if no token
Browse files Browse the repository at this point in the history
  • Loading branch information
jimga150 committed Aug 20, 2024
1 parent af0c60e commit fc663c2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Mage.Sets/src/mage/cards/a/AmzuSwarmsHunger.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public AmzuSwarmsHungerEffect copy() {
public boolean apply(Game game, Ability source) {
CreateTokenEffect effect = new CreateTokenEffect(new IzoniInsectToken());
boolean result = effect.apply(game, source);
if (!result){
return false;
}

Object cardsLeavingGraveyardObj = this.getValue("cardsLeavingGraveyard");
if (!(cardsLeavingGraveyardObj instanceof Set)) {
Expand All @@ -101,8 +104,8 @@ public boolean apply(Game game, Ability source) {
.max()
.orElse(0);

if (xvalue <= 0 || !result) {
return result;
if (xvalue <= 0) {
return true;
}
for (UUID id : effect.getLastAddedTokenIds()) {
Permanent token = game.getPermanent(id);
Expand Down

0 comments on commit fc663c2

Please sign in to comment.