Revised code for Atalya, Samite Master, Crimson Hellkite and Crypt Rats to use {X:color}

Cleaned Manacost.cpp

My observation so far when paying X in activated abilities, when X doesn't work, I press escape to get in the main menu and play another game(test again), then X activated ability will work. I really don't know where to start/look for the cause of it.
This commit is contained in:
anthonycalosa@gmail.com
2013-01-08 13:26:42 +00:00
parent e5b56cfffb
commit e69e002c1a
2 changed files with 10 additions and 59 deletions

View File

@@ -1,5 +1,5 @@
#include "PrecompiledHeader.h"
#include <boost/algorithm/string.hpp>
#include "ManaCost.h"
#include "ManaCostHybrid.h"
#include "ExtraCost.h"
@@ -89,12 +89,14 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
}
//switch on the first letter. If two costs share their first letter, add an "if" within the switch
boost::algorithm::to_lower(value);
switch (value[0])
{
case 'X':
case 'x':
if(value == "x" || value == "X")
if(value == "x")
{
manaCost->x();
}
else
{
vector<string>colorSplit = parseBetween(value,"x:"," ",false);
@@ -113,7 +115,6 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
}
}
break;
case 't': //Tap
if (value == "t")
{