From ae3cd0d5fb6e8343c0011da4f59903f775f4d27f Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Wed, 11 Apr 2012 16:46:57 +0000 Subject: [PATCH] making ifthenability fail a little more gracefully. --- projects/mtg/src/MTGAbility.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index d54b06ca7..c7731d0c5 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1251,8 +1251,9 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG } } string s1 = s; - MTGAbility * a1 = parseMagicLine(s1.substr(s1.find(" then "+1)), id, spell, card); - + MTGAbility * a1 = NULL; + if (s1.find(" then ") != string::npos) + a1 = parseMagicLine(s1.substr(s1.find(" then "+1)), id, spell, card); if(!a1) return NULL; MTGAbility * a = NEW IfThenAbility(observer, id, a1,a2, card,(Targetable*)target,checkIf[i],cond); a->canBeInterrupted = false;