From 2c34aaf8a50a6c8a23a66469e55634694b20837a Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Sun, 8 May 2011 09:32:07 +0000 Subject: [PATCH] fixed a bug intruduced by a refactor to the parsing of transforms ability with caused "newability" to be split incorrectly...im sure it was a mistake, or maybe rushed? at the point this code is "parsing between" the abilities have already been split up...all we do here is erase the "newability[" and last of "]" from the string.... --- projects/mtg/src/MTGAbility.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index dace43901..fe535ea9e 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -2036,12 +2036,14 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG newtoughnessfound = true; newtoughness = splitToughness[1]; } - vector splitAbilities = parseBetween(abilities[j], "newability[", "]"); - if(splitAbilities.size()) - { - newAbilityFound = true; - newAbilitiesList.push_back(splitAbilities[1]); - } + if(abilities[j].find("newability[") != string::npos) + { + size_t NewSkill = abilities[j].find("newability["); + size_t NewSkillEnd = abilities[j].find_last_of("]"); + string newAbilities = abilities[j].substr(NewSkill + 11,NewSkillEnd - NewSkill - 11); + newAbilitiesList.push_back(newAbilities); + newAbilityFound = true; + } } if (oneShot || forceUEOT || forceFOREVER)