magefree/mage

Regression in DoIfCostPaid - otherwise effects not applied if cost cannot be paid

Closed this issue · 2 comments

Regression from 34af538

// nothing to pay (do not support mana cost - it's true all the time)
if (!this.cost.canPay(source, source, player.getId(), game)) {
return false;
}

@JayDi85 was there a reason to do it this way instead of old way? you refactored it to return false early, but that's wrong, need to apply otherwise effects. Need to add a test for it too.

Example bug in game - [[Steamcore Scholar]], if no card meeting the criteria, then should be forced to discard two cards, but instead no discard happens at all.

note this looks like the true root cause for #13307 also, so 37fc173 can be reverted after proper fix.

Steamcore Scholar - (Gatherer) (Scryfall) (EDHREC)

{2}{U}
Creature — Weird Detective
2/2
Flying, vigilance
When this creature enters, draw two cards. Then discard two cards unless you discard an instant or sorcery card or a creature card with flying.

It’s typo in refactor for additional docs, can use old code with that comment