This removes the compilation error introduced with r4237. I needed this in place to make an iOS build.

This commit is contained in:
techdragon.nguyen@gmail.com
2012-02-01 04:17:30 +00:00
parent 2f408664ad
commit ac992675da
4 changed files with 17 additions and 23 deletions
+15 -6
View File
@@ -834,19 +834,28 @@ ManaCost * AIPlayerBaka::getPotentialMana(MTGCardInstance * target)
return result;
}
vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost * cost, map<MTGCardInstance*,bool>usedCards )
vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost * cost)
{
if(!cost || (cost && !cost->getConvertedCost()))
if(!cost || (cost && !cost->getConvertedCost()) || !target)
return vector<MTGAbility*>();
map<MTGCardInstance*, bool> usedCards;
return canPayMana(target, cost, usedCards);
}
vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost * cost, map<MTGCardInstance*,bool> &used )
{
if(!cost->getConvertedCost())
return vector<MTGAbility*>();
ManaCost * result = NEW ManaCost();
map<MTGCardInstance *, bool> used = usedCards;
vector<MTGAbility*>payments = vector<MTGAbility*>();
if (this->getManaPool()->getConvertedCost())
{
//adding the current manapool if any.
result->add(this->getManaPool());
}
int needColorConverted = cost->getConvertedCost()-int(cost->getCost(0)+cost->getCost(7));
int needColorConverted = cost->getConvertedCost() - int(cost->getCost(0)+cost->getCost(7));
int fullColor = 0;
for (size_t i = 0; i < observer->mLayers->actionLayer()->manaObjects.size(); i++)
{
@@ -1007,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 && !usedCards.size())
if(cost->kicker && !used.size())
{
ManaCost * withKickerCost= NEW ManaCost(cost->kicker);
@@ -1016,7 +1025,7 @@ vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost *
bool keepLooking = true;
while(keepLooking)
{
kickerPayment = canPayMana(target,withKickerCost,used);
kickerPayment = canPayMana(target, withKickerCost, used);
if(kickerPayment.size())
{
for(unsigned int w = 0;w < kickerPayment.size();++w)
-13
View File
@@ -25,8 +25,6 @@ bool AIPlayerBakaB::payTheManaCost(ManaCost * cost, MTGCardInstance * target, ve
return AIPlayerBaka::payTheManaCost(cost, target, gotPayments);
}
int AIPlayerBakaB::getEfficiency(OrderedAIAction * action)
{
return AIPlayerBaka::getEfficiency(action);
@@ -37,17 +35,6 @@ ManaCost * AIPlayerBakaB::getPotentialMana(MTGCardInstance * target)
return AIPlayerBaka::getPotentialMana(target);
}
vector<MTGAbility*> AIPlayerBakaB::canPayMana(MTGCardInstance * target,ManaCost * cost)
{
return AIPlayerBaka::canPayMana(target, cost);
}
vector<MTGAbility*> AIPlayerBakaB::canPaySunBurst(ManaCost * cost)
{
return AIPlayerBaka::canPaySunBurst(cost);
}
int AIPlayerBakaB::CanHandleCost(ManaCost * cost)
{
return AIPlayerBaka::CanHandleCost(cost);