From c1351c233953b32d8b4c30bc857a77fa42b81cf3 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Fri, 3 Jan 2020 17:33:03 +0400 Subject: [PATCH] * Play from top library - fixed that unplayable lands marks as playable; --- Mage/src/main/java/mage/players/PlayerImpl.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index 5c423d5571..c2331b2681 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -3281,10 +3281,16 @@ public abstract class PlayerImpl implements Player, Serializable { boolean isPlayLand = (ability instanceof PlayLandAbility); // as original controller + + // land restrictions + if (isPlayLand && game.getContinuousEffects().preventedByRuleModification( + GameEvent.getEvent(GameEvent.EventType.PLAY_LAND, ability.getSourceId(), + ability.getSourceId(), this.getId()), ability, game, true)) { + continue; + } + MageObjectReference permittingObject; if (isPlaySpell || isPlayLand) { - // play land restriction - // play hand from non hand zone permittingObject = game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, ability, this.getId(), game); @@ -3296,8 +3302,6 @@ public abstract class PlayerImpl implements Player, Serializable { boolean canActivateAsHandZone = permittingObject != null || (fromZone == Zone.GRAVEYARD && canPlayCardsFromGraveyard()); - // TODO: add play land restrictions - // as affected controller UUID savedControllerId = ability.getControllerId(); ability.setControllerId(this.getId());