[C17] Fix Mirri restriction effect for blockers. Closes #5215 (#9384)

This commit is contained in:
Grath 2022-08-22 21:28:09 -04:00 committed by GitHub
parent 65fc421f50
commit 7b64fc6ed4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,12 +78,13 @@ class MirriWeatherlightDuelistBlockRestrictionEffect extends RestrictionEffect {
}
@Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
public boolean canBlock(Permanent attacker, Permanent newBlocker, Ability source, Game game, boolean canUseChooseDialogs) {
if (attacker == null) {
return true;
}
for (UUID creature : game.getCombat().getBlockers()) {
if (game.getPlayer(game.getPermanent(creature).getOwnerId()).hasOpponent(attacker.getControllerId(), game)) {
for (UUID creatureId : game.getCombat().getBlockers()) {
Permanent existingBlocker = game.getPermanent(creatureId);
if (game.getPlayer(existingBlocker.getControllerId()).hasOpponent(attacker.getControllerId(), game) && existingBlocker.isControlledBy(newBlocker.getControllerId())) {
return false;
}
}