Added/fixed primitives, fixed/improved several primitives with "reveal" ability, added a new keyword "findfirsttype" to allow AI to user a kind of "revealuntil" ability from its library, fixed a crash wthen temp zone has duplicated cards from other zones (such as library).

This commit is contained in:
Vittorio Alfieri
2021-02-12 11:57:27 +01:00
parent a72c35a693
commit d3c0e397b6
4 changed files with 114 additions and 59 deletions
+7
View File
@@ -149,6 +149,13 @@ void MTGPlayerCards::initDeck(MTGDeck * deck)
MTGPlayerCards::~MTGPlayerCards()
{
if(temp->cards.size() > 0){
for(size_t i = 0; i < library->placeOnTop.size(); i++){
if(temp->hasCard(library->placeOnTop[i])){
temp->removeCard(library->placeOnTop[i]); // Fix crash when temp zone contains library place on top cards.
}
}
}
SAFE_DELETE(library);
SAFE_DELETE(graveyard);
SAFE_DELETE(hand);