-fix a crash when the AI tries to use a spell with X in the manacost
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-09-28 14:12:50 +00:00
parent f7331b7066
commit d9464f53c2
6 changed files with 51 additions and 8 deletions

View File

@@ -121,6 +121,13 @@ Spell::Spell(int id, MTGCardInstance * _source, TargetChooser * tc, ManaCost * _
from = _source->getCurrentZone();
}
int Spell::computeX(MTGCardInstance * card){
ManaCost * c = cost->Diff(card->getManaCost());
int x = c->getCost(Constants::MTG_NB_COLORS);
delete c;
return x;
}
bool Spell::kickerWasPaid(){
return (payResult == ManaCost::MANA_PAID_WITH_KICKER);
}