From fdfcaf854d8e0fb2c83756c1d2bfa694732d29b3 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Mon, 5 Sep 2011 17:40:25 +0000 Subject: [PATCH] changed a piece of logic back to it's original logic, the refactor in last commit broke some functionality in multitarget effects which have no test added yet. --- projects/mtg/src/MTGAbility.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 79f5e9b2b..93b514cd5 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -2721,8 +2721,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card, int if(moreThanOneTarget) a->target = spell->getNextTarget(); - if(a->target && moreThanOneTarget - && !dynamic_cast(a)) //MayAbility is an exception to multitargets, as we don't want to add the same text n times to a menu + if(a->target && moreThanOneTarget) { while(a->target) { @@ -2730,11 +2729,20 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card, int { a->resolve(); } - else + else if(!dynamic_cast(a)) { MTGAbility * mClone = a->clone(); mClone->addToGame(); } + else if(dynamic_cast(a) && a->target == spell->tc->targets[0]) + { + //this only keeps a menu objects from displaying multiple options of the same ability during the resolve of a multiability effect. + //meaning as long as it is targeting the first target add it, else don't display it again. + //this does not make "may" abilities an exception to multitarget simply on mayabilities resolving from a multitarget + //spell, only display the menu once. this is purely cosmetic. + MTGAbility * mClone = a->clone(); + mClone->addToGame(); + } a->target = spell->getNextTarget(a->target); } SAFE_DELETE(a);