forked from External/mage
Fixed NPE errors in canAttack restrict checks;
This commit is contained in:
parent
dd2cf5a939
commit
454d76e30b
17 changed files with 128 additions and 106 deletions
|
|
@ -1,9 +1,5 @@
|
|||
|
||||
package mage.game.command.planes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.ActivateIfConditionActivatedAbility;
|
||||
|
|
@ -33,8 +29,11 @@ import mage.target.Target;
|
|||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.watchers.common.PlanarRollWatcher;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public class AgyremPlane extends Plane {
|
||||
|
|
@ -152,6 +151,10 @@ class AgyremRestrictionEffect extends RestrictionEffect {
|
|||
|
||||
@Override
|
||||
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) {
|
||||
if (defenderId == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Plane cPlane = game.getState().getCurrentPlane();
|
||||
if (cPlane != null && cPlane.getName().equalsIgnoreCase("Plane - Agyrem")) {
|
||||
return !defenderId.equals(source.getControllerId());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue