- Prevented possibleDamagePrevention from giving errors if a permanent with an AF Countermagic ability is around.

This commit is contained in:
Sloth
2011-09-07 14:32:51 +00:00
parent ca4c882924
commit 42f5cc23ee

View File

@@ -1285,10 +1285,10 @@ public class ComputerUtil {
// if SA is from AF_Counter don't add to getPlayable
//This try/catch should fix the "computer is thinking" bug
try {
if (sa.canPlay() && ComputerUtil.canPayCost(sa, controller) && sa.getAbilityFactory() != null && sa.isAbility()) {
if (sa.getAbilityFactory() != null && sa.isAbility()) {
AbilityFactory af = sa.getAbilityFactory();
HashMap<String, String> mapParams = af.getMapParams();
if (mapParams.get("AB").equals("PreventDamage")) {
if (mapParams.get("AB").equals("PreventDamage") && sa.canPlay() && ComputerUtil.canPayCost(sa, controller)) {
if (AbilityFactory.getDefinedCards(sa.getSourceCard(), mapParams.get("Defined"), sa).contains(card))
prevented += AbilityFactory.calculateAmount(af.getHostCard(), mapParams.get("Amount"), sa);
Target tgt = sa.getTarget();