diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 0e1a6b5f5..1a9551ac6 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -2520,6 +2520,8 @@ public: } int addToGame(){ MTGCardInstance * _target = (MTGCardInstance *)target; + if (_target){ + while (_target->next) _target=_target->next; for (int j = 0; j < Constants::MTG_NB_COLORS; j++){ if (_target->hasColor(j)) oldcolors.push_back(j); @@ -2530,15 +2532,21 @@ public: for ( it=colors.begin(); it != colors.end(); it++){_target->setColor(*it);} for ( it=abilities.begin() ; it != abilities.end(); it++ ){_target->basicAbilities[*it]++;} for ( it=oldcolors.begin() ; it != oldcolors.end(); it++ ){} - return MTGAbility::addToGame();} + } + return MTGAbility::addToGame(); + } int destroy(){ MTGCardInstance * _target = (MTGCardInstance *)target; + if (_target){ + while (_target->next) _target=_target->next; list::iterator it; for ( it=types.begin() ; it != types.end(); it++ ){_target->removeType(*it);} for ( it=colors.begin() ; it != colors.end(); it++ ){_target->removeColor(*it);} for ( it=abilities.begin() ; it != abilities.end(); it++ ){_target->basicAbilities[*it]--;} for ( it=oldcolors.begin() ; it != oldcolors.end(); it++ ){_target->setColor(*it);} - return 1;} + } + return 1; + } ATransformer * clone() const{ ATransformer * a = NEW ATransformer(*this); a->isClone = 1; @@ -2596,12 +2604,16 @@ public: } int addToGame(){ MTGCardInstance * _target = (MTGCardInstance *)target; + if (_target){ + while (_target->next) _target=_target->next; list::iterator it; for( it=colors.begin(); it != colors.end();it++){ _target->setColor(0,1);} for ( it=types.begin() ; it != types.end(); it++ ){_target->addType(*it);} for ( it=colors.begin() ; it != colors.end(); it++ ){_target->setColor(*it);} for ( it=abilities.begin() ; it != abilities.end(); it++ ){_target->basicAbilities[*it]++;} - return MTGAbility::addToGame();} + } + return MTGAbility::addToGame(); + } ATransformerFOREVER * clone() const{ ATransformerFOREVER * a = NEW ATransformerFOREVER(*this); a->isClone = 1;