1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

* a few fixes for CStack.effects removal - more should come

This commit is contained in:
mateuszb
2010-08-31 10:22:21 +00:00
parent 4696d89d2e
commit 608e26b453
6 changed files with 63 additions and 33 deletions

View File

@ -3010,17 +3010,18 @@ void CBattleInterface::showAliveStack(int ID, const std::map<int, CStack> & stac
//blitting amoutn background box
SDL_Surface *amountBG = NULL;
if(!curStack.bonuses.size())
BonusList spellEffects = curStack.getSpellBonuses();
if(!spellEffects.size())
{
amountBG = amountNormal;
}
else
{
int pos=0; //determining total positiveness of effects
for(BonusList::const_iterator it = curStack.bonuses.begin(); it != curStack.bonuses.end(); it++)
std::vector<si32> spellIds = curStack.activeSpells();
for(std::vector<si32>::const_iterator it = spellIds.begin(); it != spellIds.end(); it++)
{
if (it->source == Bonus::CASTED_SPELL)
pos += CGI->spellh->spells[ it->id ].positiveness;
pos += CGI->spellh->spells[ *it ].positiveness;
}
if(pos > 0)
{