Fix Segmentation Fault & Formatting
This commit is contained in:
@@ -94,7 +94,7 @@ 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
|
||||
std::transform(value.begin(), value.end(), value.begin(), ::tolower);
|
||||
std::transform(value.begin(), value.end(), value.begin(), ::tolower);
|
||||
switch (value[0])
|
||||
{
|
||||
case 'x':
|
||||
@@ -695,7 +695,7 @@ ManaCostHybrid * ManaCost::getHybridCost(unsigned int i)
|
||||
ExtraCost * ManaCost::getExtraCost(unsigned int i)
|
||||
{
|
||||
if(extraCosts && extraCosts->costs.size())
|
||||
{
|
||||
{
|
||||
if (extraCosts->costs.size() <= i)
|
||||
return NULL;
|
||||
return extraCosts->costs[i];
|
||||
@@ -1055,7 +1055,7 @@ ostream& operator<<(ostream& out, ManaCost m)
|
||||
|
||||
void ManaPool::Empty()
|
||||
{
|
||||
SAFE_DELETE(extraCosts);
|
||||
SAFE_DELETE(extraCosts);
|
||||
SAFE_DELETE(kicker);
|
||||
SAFE_DELETE(alternative);
|
||||
SAFE_DELETE(BuyBack);
|
||||
|
||||
Reference in New Issue
Block a user