mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 14:32:06 -08:00
fix #13433 (DoIfCostPaid regression), add test
This commit is contained in:
parent
bf8c8c4e99
commit
7b03af3de3
2 changed files with 30 additions and 7 deletions
|
|
@ -98,16 +98,12 @@ public class DoIfCostPaid extends OneShotEffect {
|
|||
if (player == null || mageObject == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
String message = CardUtil.replaceSourceName(makeChooseText(game, source), mageObject.getName());
|
||||
Outcome payOutcome = executingEffects.getOutcome(source, this.outcome);
|
||||
// nothing to pay (do not support mana cost - it's true all the time)
|
||||
boolean canPay = cost.canPay(source, source, player.getId(), game);
|
||||
boolean didPay = false;
|
||||
if (!optional || player.chooseUse(payOutcome, message, source, game)) {
|
||||
if (canPay && (!optional || player.chooseUse(payOutcome, message, source, game))) {
|
||||
cost.clearPaid();
|
||||
int bookmark = game.bookmarkState();
|
||||
if (cost.pay(source, game, source, player.getId(), false)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue