fix crash bug when buying a card pack

This fixes the shop crashing the game when you buy a card packs in the
shop. The targeting indicator looks at the stack so it needs to be
enabled only when you're in the "game"...
This commit is contained in:
Anthony Calosa
2015-10-10 04:59:22 +08:00
parent 03f5ba430c
commit 52803cf57c

View File

@@ -248,6 +248,8 @@ void CardGui::Render()
renderer->RenderQuad(fakeborder.get(), actX, actY, actT, (29 * actZ + 1) / 16, 42 * actZ / 16);
}
//draw border for highlighting
if (game)
{
if (card && card->isTargetted() && highlightborder)
{
highlightborder->SetColor(ARGB(95,255,0,0));
@@ -258,6 +260,7 @@ void CardGui::Render()
highlightborder->SetColor(ARGB(95,0,245,0));
renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16);
}
}
//draw the card image
renderer->RenderQuad(quad.get(), actX, actY, actT, scale, scale);
}
@@ -300,6 +303,8 @@ void CardGui::Render()
}
//draw line
if (game)
{
if (card && card->isTargetted())
{
if(card->isTapped())
@@ -324,6 +329,7 @@ void CardGui::Render()
else
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,actY - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,0,255,0));
}
}
//draws the numbers power/toughness
if (card->isCreature())