From 772ddd9cedae25f92b21bdd0a869d0cd623929e5 Mon Sep 17 00:00:00 2001 From: "wagic.laurent" Date: Mon, 26 Oct 2009 13:20:08 +0000 Subject: [PATCH] Laurent - fixed a bug with @damaged. Without this quick and dirty fix if you have 2 thieving magpie in play you get twice the bonus if only 1 deals damage (also you draw 2 cards instead of 1). --- projects/mtg/src/MTGAbility.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index c50f90390..5f9105850 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -116,16 +116,18 @@ TriggeredAbility * AbilityFactory::parseTrigger(string magicText, int id, Spell TargetChooserFactory tcf; TargetChooser *tc = tcf.createTargetChooser(starget,card); tc->targetter = NULL; - - TargetChooser *fromTc = NULL; found = s.find("from("); - if (found != string::npos){ + + TargetChooser *fromTc = NULL; + if (found != string::npos){ end = s.find (")", found); starget = s.substr(found+5,end - found - 5); TargetChooser * fromTc = tcf.createTargetChooser(starget,card); fromTc->targetter = NULL; - } return NEW TrDamaged(id,card,tc,fromTc); + }else{ + return NEW TrDamaged(id,card,tc,fromTc); + } } int who = 0;