From 6f8ee8e3de9e240a280f92d516eed42b6fd9465a Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 29 May 2013 21:02:00 +0200 Subject: [PATCH] Fixed blocking change for AI player not locking the game. --- .../src/mage/sets/gatecrash/AlphaAuthority.java | 3 ++- Mage/src/mage/game/combat/Combat.java | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/gatecrash/AlphaAuthority.java b/Mage.Sets/src/mage/sets/gatecrash/AlphaAuthority.java index 2aa4cb6bd08..f7428245351 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/AlphaAuthority.java +++ b/Mage.Sets/src/mage/sets/gatecrash/AlphaAuthority.java @@ -49,6 +49,7 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; +import mage.util.CardUtil; /** * @@ -99,7 +100,7 @@ class CantBeBlockedByMoreThanOneAttachedEffect extends ContinuousEffectImpl { if (game.isPaused() || game.isGameOver()) { return; } - choose = !checkBlockRestrictions(game.getPlayer(defenderId), game); - choose |= !checkBlockRequirementsAfter(defender, defender, game); + if (!checkBlockRestrictions(game.getPlayer(defenderId), game)) { + // only human player can decide to do the block in another way + if (player.isHuman()) { + continue; + } + } + + choose = !checkBlockRequirementsAfter(defender, defender, game); } game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DECLARED_BLOCKERS, defenderId, defenderId)); } @@ -266,6 +272,12 @@ public class Combat implements Serializable, Copyable { } } +/** + * Check the block restrictions + * @param player + * @param game + * @return false - if block restrictions were not complied + */ public boolean checkBlockRestrictions(Player player, Game game) { int count = 0; boolean blockWasLegal = true;