Standard Bearer - fixed that cards with TargetsHaveToTargetPermanentIfAbleEffect can brake multi-modes cards (can be related to #9769)

This commit is contained in:
Oleg Agafonov 2023-10-02 14:12:56 +04:00
parent d9ca387fad
commit 9d1ad256a5

View file

@ -94,9 +94,10 @@ public class TargetsHaveToTargetPermanentIfAbleEffect extends ContinuousRuleModi
if (!stackAbility.isControlledBy(targetingPlayer.getId())) { if (!stackAbility.isControlledBy(targetingPlayer.getId())) {
return false; return false;
} }
Ability ability = (Ability) getValue("targetAbility"); Ability targetAbility = (Ability) getValue("targetAbility");
if (ability != null) { if (targetAbility != null) {
// Get all the allowed permanents on the battlefield in range of the abilities controller // Get all the allowed permanents on the battlefield in range of the abilities controller
Ability ability = targetAbility.copy(); // must use a copy for diff modes checking
List<Permanent> allowedPermanents = game.getBattlefield().getActivePermanents(filter, event.getPlayerId(), source, game); List<Permanent> allowedPermanents = game.getBattlefield().getActivePermanents(filter, event.getPlayerId(), source, game);
if (!allowedPermanents.isEmpty()) { if (!allowedPermanents.isEmpty()) {
boolean canTargetAllowedPermanent = false; boolean canTargetAllowedPermanent = false;