added more debug information to ensure correct string length of MANA meta data

This commit is contained in:
techdragon.nguyen@gmail.com
2011-01-31 10:30:20 +00:00
parent c68a989915
commit fdd55dc22e
+7 -3
View File
@@ -258,15 +258,19 @@ void DeckMenu::Render()
if (mSelectedDeck &&displayDeckMana) if (mSelectedDeck &&displayDeckMana)
{ {
string deckManaColors = mSelectedDeck->getColorIndex(); string deckManaColors = mSelectedDeck->getColorIndex();
if ( deckManaColors.compare("") != 0 ) if ( deckManaColors.compare("") != 0 && ( deckManaColors.length() == 6 ))
for( int colorIdx = Constants::MTG_COLOR_ARTIFACT; colorIdx < 5; ++colorIdx ) {
{ for( int colorIdx = Constants::MTG_COLOR_ARTIFACT; colorIdx < Constants::MTG_COLOR_LAND; ++colorIdx )
{
if ( (deckManaColors.at(colorIdx) == '1') != 0) if ( (deckManaColors.at(colorIdx) == '1') != 0)
{ {
renderer->RenderQuad(manaIcons[colorIdx], manaIconX, manaIconY); renderer->RenderQuad(manaIcons[colorIdx], manaIconX, manaIconY);
manaIconX += 30; manaIconX += 30;
} }
} }
}
else
DebugTrace("Error with color index string for "<< mSelectedDeck->getName() << ". [" << deckManaColors << "].");
} }
renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE); renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE);