Erwan
-fix a crash when the AI tries to use a spell with X in the manacost
This commit is contained in:
@@ -699,10 +699,8 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode){
|
||||
|
||||
//Returns the "X" cost that was paid for a spell
|
||||
int AbilityFactory::computeX(Spell * spell, MTGCardInstance * card){
|
||||
ManaCost * c = spell->cost->Diff(card->getManaCost());
|
||||
int x = c->getCost(Constants::MTG_NB_COLORS);
|
||||
delete c;
|
||||
return x;
|
||||
if (spell) return spell->computeX(card);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Some basic functionalities that can be added automatically in the text file
|
||||
|
||||
Reference in New Issue
Block a user