reworked some logic that was changed in last commit.

This commit is contained in:
omegablast2002@yahoo.com
2012-02-01 12:44:11 +00:00
parent ed30af9aab
commit 0d223b5561
2 changed files with 5 additions and 6 deletions
+4 -5
View File
@@ -843,7 +843,7 @@ vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost *
return canPayMana(target, cost, usedCards);
}
vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost * cost, map<MTGCardInstance*,bool> &used )
vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost * cost, map<MTGCardInstance*,bool> &used ,bool searchingAgain)
{
if(!cost->getConvertedCost())
return vector<MTGAbility*>();
@@ -1016,7 +1016,7 @@ vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost *
return payments;//we didn't meet one of the color cost requirements.
}
}
if(cost->kicker && !used.size())
if(cost->kicker && !searchingAgain)
{
ManaCost * withKickerCost= NEW ManaCost(cost->kicker);
@@ -1025,15 +1025,14 @@ vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost *
bool keepLooking = true;
while(keepLooking)
{
kickerPayment = canPayMana(target, withKickerCost, used);
kickerPayment = canPayMana(target, withKickerCost, used,true);
if(kickerPayment.size())
{
for(unsigned int w = 0;w < kickerPayment.size();++w)
{
if(!used[kickerPayment[w]->source])
if(used[kickerPayment[w]->source])
{
payments.push_back(kickerPayment[w]);
used[kickerPayment[w]->source] = true;
}
}
canKick += 1;