mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
Fixed NPE in mad ai
This commit is contained in:
parent
55bf5714a0
commit
aa224dee2f
1 changed files with 20 additions and 14 deletions
|
|
@ -1120,6 +1120,7 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
|||
}
|
||||
|
||||
private boolean isEffectiveAttacker(Game game, UUID attackingPlayerId, UUID defenderId, Permanent attacker, int life, int poison) {
|
||||
try {
|
||||
SurviveInfo info = CombatUtil.getCombatInfo(game, attackingPlayerId, defenderId, attacker);
|
||||
if (info.isAttackerDied()) {
|
||||
return false;
|
||||
|
|
@ -1136,6 +1137,11 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
|||
if (info.isTriggered()) {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// swallow exception and return false
|
||||
logger.error(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue