Fix for issue 518, Shop "background light" image "candle effect" not working. Basically some bad math made the alpha clamp all the time at its max value of 50. Now we pick a random number distribution between -25 and + 25 for the alpha offset value.

This commit is contained in:
wrenczes@gmail.com
2010-12-02 07:42:32 +00:00
parent 2693f35506
commit 720ee30c9a

View File

@@ -455,7 +455,7 @@ void GameStateShop::Update(float dt)
if (menu && menu->isClosed())
SAFE_DELETE(menu);
srcCards->Update(dt);
alphaChange = static_cast<int> (500 - (int) ((rand() % 1000)) * dt);
alphaChange = 25 - static_cast<int>((float) (rand() - 1) / (RAND_MAX) * 50.0f);
lightAlpha += alphaChange;
if (lightAlpha < 0)
lightAlpha = 0;