From a36b47e5003480393fa5dca649634862aa2a6008 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Wed, 1 Jun 2016 09:14:47 +0800 Subject: [PATCH] try to fix psp compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit travis error: ../projects/mtg/src/ManaCost.cpp:263:23: error: unused variable ‘counterCheck’ [-Werror=unused-variable] --- projects/mtg/src/ManaCost.cpp | 64 +++++++++++++++++------------------ 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/projects/mtg/src/ManaCost.cpp b/projects/mtg/src/ManaCost.cpp index af048eec7..b4c54139e 100644 --- a/projects/mtg/src/ManaCost.cpp +++ b/projects/mtg/src/ManaCost.cpp @@ -260,41 +260,39 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan { manaCost->addExtraCost(NEW CycleCost(tc)); } - else if(size_t counterCheck = value.find("(") != string::npos) + else if(value == "c") { - size_t counter_start = value.find("("); - size_t counter_end = value.find(")", counter_start); - AbilityFactory abf(g); - string counterString = value.substr(counter_start + 1, counter_end - counter_start - 1); - Counter * counter = abf.parseCounter(counterString, c); - size_t separator = value.find(",", counter_start); - size_t separator2 = string::npos; - if (separator != string::npos) - { - separator2 = value.find(",", counter_end + 1); - } - SAFE_DELETE(tc); - size_t target_start = string::npos; - if (separator2 != string::npos) - { - target_start = value.find(",", counter_end + 1); - } - size_t target_end = value.length(); - if (target_start != string::npos && target_end != string::npos) - { - string target = value.substr(target_start + 1, target_end - 1 - target_start); - tc = tcf.createTargetChooser(target, c); - } - manaCost->addExtraCost(NEW CounterCost(counter, tc)); - break; + manaCost->add(Constants::MTG_COLOR_WASTE, 1); + break; + } + else + { + size_t counter_start = value.find("("); + size_t counter_end = value.find(")", counter_start); + AbilityFactory abf(g); + string counterString = value.substr(counter_start + 1, counter_end - counter_start - 1); + Counter * counter = abf.parseCounter(counterString, c); + size_t separator = value.find(",", counter_start); + size_t separator2 = string::npos; + if (separator != string::npos) + { + separator2 = value.find(",", counter_end + 1); + } + SAFE_DELETE(tc); + size_t target_start = string::npos; + if (separator2 != string::npos) + { + target_start = value.find(",", counter_end + 1); + } + size_t target_end = value.length(); + if (target_start != string::npos && target_end != string::npos) + { + string target = value.substr(target_start + 1, target_end - 1 - target_start); + tc = tcf.createTargetChooser(target, c); + } + manaCost->addExtraCost(NEW CounterCost(counter, tc)); + break; } - else if (value == "c") - { - manaCost->add(Constants::MTG_COLOR_WASTE, 1); - break; - - } - break; } default: //uncolored cost and hybrid costs and special cost