fix NPE error in AI when using AF_Discard with "Mode$ RevealDiscardAll"

This commit is contained in:
jendave
2011-08-07 01:47:59 +00:00
parent 556552842f
commit 15655c9e84

View File

@@ -1042,7 +1042,7 @@ public class AbilityFactory_ZoneAffecting {
} }
} }
if(!params.get("Mode").equals("Hand")) { if(!params.get("Mode").equals("Hand") && !params.get("Mode").equals("RevealDiscardAll")) {
if (params.get("NumCards").equals("X") && source.getSVar("X").equals("Count$xPaid")){ if (params.get("NumCards").equals("X") && source.getSVar("X").equals("Count$xPaid")){
// Set PayX here to maximum value. // Set PayX here to maximum value.
int cardsToDiscard = Math.min(ComputerUtil.determineLeftoverMana(sa), int cardsToDiscard = Math.min(ComputerUtil.determineLeftoverMana(sa),