mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- NPE guard.
This commit is contained in:
@@ -107,11 +107,13 @@ public class MustBlockAi extends SpellAbilityAi {
|
|||||||
if (source.hasKeyword(Keyword.PROVOKE) && blocker.isTapped()) {
|
if (source.hasKeyword(Keyword.PROVOKE) && blocker.isTapped()) {
|
||||||
// Don't provoke if the attack is potentially lethal
|
// Don't provoke if the attack is potentially lethal
|
||||||
Combat combat = ai.getGame().getCombat();
|
Combat combat = ai.getGame().getCombat();
|
||||||
Player defender = combat.getDefenderPlayerByAttacker(source);
|
if (combat != null) {
|
||||||
if (combat != null && combat.getAttackingPlayer().equals(ai)
|
Player defender = combat.getDefenderPlayerByAttacker(source);
|
||||||
&& defender.canLoseLife() && !defender.cantLoseForZeroOrLessLife()
|
if (defender != null && combat.getAttackingPlayer().equals(ai)
|
||||||
&& ComputerUtilCombat.lifeThatWouldRemain(defender, combat) <= 0) {
|
&& defender.canLoseLife() && !defender.cantLoseForZeroOrLessLife()
|
||||||
return false;
|
&& ComputerUtilCombat.lifeThatWouldRemain(defender, combat) <= 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user