mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
* Fixed possible exception when planswalker were removed from battlefield.
This commit is contained in:
parent
60faf6378a
commit
bd43cf0e1e
1 changed files with 2 additions and 4 deletions
|
|
@ -830,8 +830,7 @@ public class Combat implements Serializable, Copyable<Combat> {
|
|||
blockIsValid = true;
|
||||
break CombatGroups;
|
||||
} else // check if the blocker blocks a attacker that must be blocked at least by one and is the only blocker, this block is also valid
|
||||
{
|
||||
if (combatGroup.getBlockers().size() == 1) {
|
||||
if (combatGroup.getBlockers().size() == 1) {
|
||||
if (mustBeBlockedByAtLeastOne.containsKey(forcingAttackerId)) {
|
||||
if (mustBeBlockedByAtLeastOne.get(forcingAttackerId).contains(creatureForcedToBlock.getId())) {
|
||||
blockIsValid = true;
|
||||
|
|
@ -839,7 +838,6 @@ public class Combat implements Serializable, Copyable<Combat> {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1113,7 +1111,7 @@ public class Combat implements Serializable, Copyable<Combat> {
|
|||
public boolean removePlaneswalkerFromCombat(UUID planeswalkerId, Game game, boolean withInfo) {
|
||||
boolean result = false;
|
||||
for (CombatGroup group : groups) {
|
||||
if (group.getDefenderId().equals(planeswalkerId)) {
|
||||
if (group.getDefenderId() != null && group.getDefenderId().equals(planeswalkerId)) {
|
||||
group.removeAttackedPlaneswalker(planeswalkerId);
|
||||
result = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue