Fix for issue 962 (Hexproof) by Dmitri

This commit is contained in:
wagic.the.homebrew@gmail.com
2013-09-15 02:57:29 +00:00
parent 7b8189bd13
commit bd25b12fb2
5 changed files with 34 additions and 7 deletions
+3 -3
View File
@@ -179,16 +179,16 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
rtc = comparasion[i].substr(foundType + 5, end - foundType - 5).c_str();
TargetChooserFactory tcf(observer);
TargetChooser * ttc = tcf.createTargetChooser(rtc,card);
ttc->withoutProtections = true;
mod = atoi(comparasion[i].substr(end+1).c_str());
bool withoutProtections = true;
if(i == 2)
{
secondAmount = ttc->countValidTargets();
secondAmount = ttc->countValidTargets(withoutProtections);
secondAmount += mod;
}
else
{
firstAmount = ttc->countValidTargets();
firstAmount = ttc->countValidTargets(withoutProtections);
firstAmount += mod;
}
+2 -2
View File
@@ -919,7 +919,7 @@ bool TargetChooser::validTargetsExist(int maxTargets)
return false;
}
int TargetChooser::countValidTargets()
int TargetChooser::countValidTargets(bool withoutProtections)
{
int result = 0;
@@ -943,7 +943,7 @@ int TargetChooser::countValidTargets()
{
for (int j = 0; j < z->nb_cards; j++)
{
if (canTarget(z->cards[j])) result++;
if (canTarget(z->cards[j], withoutProtections)) result++;
}
}
}