Merge branch 'fixsuspend' into 'master'

Suspend Fixes

See merge request core-developers/forge!4828
This commit is contained in:
Michael Kamensky
2021-06-06 03:29:09 +00:00
4 changed files with 5 additions and 5 deletions

View File

@@ -1354,7 +1354,7 @@ public class AiController {
public AiPlayDecision canPlayFromEffectAI(Spell spell, boolean mandatory, boolean withoutPayingManaCost) { public AiPlayDecision canPlayFromEffectAI(Spell spell, boolean mandatory, boolean withoutPayingManaCost) {
int damage = ComputerUtil.getDamageForPlaying(player, spell); int damage = ComputerUtil.getDamageForPlaying(player, spell);
if (damage >= player.getLife() && !player.cantLoseForZeroOrLessLife() && player.canLoseLife()) { if (!mandatory && damage >= player.getLife() && !player.cantLoseForZeroOrLessLife() && player.canLoseLife()) {
return AiPlayDecision.CurseEffects; return AiPlayDecision.CurseEffects;
} }

View File

@@ -297,7 +297,7 @@ public class PermanentAi extends SpellAbilityAi {
if (!checkPhaseRestrictions(ai, sa, ai.getGame().getPhaseHandler())) { if (!checkPhaseRestrictions(ai, sa, ai.getGame().getPhaseHandler())) {
return false; return false;
} }
return mandatory || checkApiLogic(ai, sa); return checkApiLogic(ai, sa) || mandatory;
} }
} }

View File

@@ -192,7 +192,7 @@ public class PlayAi extends SpellAbilityAi {
spell = (Spell) spell.copyWithDefinedCost(abCost); spell = (Spell) spell.copyWithDefinedCost(abCost);
} }
if( AiPlayDecision.WillPlay == ((PlayerControllerAi)ai.getController()).getAi().canPlayFromEffectAI(spell, !isOptional, true)) { if (AiPlayDecision.WillPlay == ((PlayerControllerAi)ai.getController()).getAi().canPlayFromEffectAI(spell, !isOptional, true)) {
// Before accepting, see if the spell has a valid number of targets (it should at this point). // Before accepting, see if the spell has a valid number of targets (it should at this point).
// Proceeding past this point if the spell is not correctly targeted will result // Proceeding past this point if the spell is not correctly targeted will result
// in "Failed to add to stack" error and the card disappearing from the game completely. // in "Failed to add to stack" error and the card disappearing from the game completely.

View File

@@ -704,8 +704,8 @@ public abstract class SpellAbilityEffect {
Card host = sa.getHostCard(); Card host = sa.getHostCard();
final Game game = host.getGame(); final Game game = host.getGame();
final String duration = sa.getParam("Duration"); final String duration = sa.getParam("Duration");
// in case host was LKI // in case host was LKI or still resolving
if (host.isLKI()) { if (host.isLKI() || host.getZone().is(ZoneType.Stack)) {
host = game.getCardState(host); host = game.getCardState(host);
} }