check imprinted card

fix crash
This commit is contained in:
Anthony Calosa
2016-08-21 11:28:17 +08:00
parent 6a213bffa6
commit 15a8437d79

View File

@@ -7576,6 +7576,12 @@ void AACastCard::Update(float dt)
}
}
theNamedCard = makeCard();
//if somehow the imprinted card leaves its zone destroy this...
if(cardNamed.find("imprintedcard") != string::npos && !theNamedCard)
{
this->forceDestroy = 1;
return;
}
}
if(putinplay)
{
@@ -7669,6 +7675,7 @@ MTGCardInstance * AACastCard::makeCard()
{
MTGCardInstance * card = NULL;
MTGCard * cardData = MTGCollection()->getCardByName(cardNamed);
if(!cardData) return NULL;
card = NEW MTGCardInstance(cardData, source->controller()->game);
card->owner = source->controller();
source->controller()->game->temp->addCard(card);