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

patch from KroArtem

This commit is contained in:
Ivan Savenko
2013-11-03 12:51:25 +00:00
parent c4716d0a9a
commit 0e3eae3095
15 changed files with 42 additions and 84 deletions

View File

@ -1715,7 +1715,7 @@ std::vector<SecondarySkill> CGHeroInstance::levelUpProposedSkills() const
{
skills.push_back (obligatorySkills[0]);
}
else if(basicAndAdv.size())
else if(!basicAndAdv.empty())
{
SecondarySkill s = type->heroClass->chooseSecSkill(basicAndAdv);//upgrade existing
skills.push_back(s);
@ -1736,7 +1736,7 @@ std::vector<SecondarySkill> CGHeroInstance::levelUpProposedSkills() const
{
skills.push_back(type->heroClass->chooseSecSkill(none)); //new skill
}
else if(basicAndAdv.size())
else if(!basicAndAdv.empty())
{
skills.push_back(type->heroClass->chooseSecSkill(basicAndAdv)); //upgrade existing
}
@ -5573,7 +5573,7 @@ void CGPandoraBox::giveContentsAfterExp(const CGHeroInstance *h) const
spellsToGive.insert(*i);
}
}
if(spellsToGive.size())
if(!spellsToGive.empty())
{
cb->changeSpells(h,true,spellsToGive);
cb->showInfoDialog(&iw);
@ -7264,7 +7264,7 @@ void CArmedInstance::updateMoraleBonusFromArmy()
b->val = +1;
b->description = VLC->generaltexth->arraytxt[115]; //All troops of one alignment +1
}
else if (factions.size()) // no bonus from empty garrison
else if (!factions.empty()) // no bonus from empty garrison
{
b->val = 2 - factionsInArmy;
b->description = boost::str(boost::format(VLC->generaltexth->arraytxt[114]) % factionsInArmy % b->val); //Troops of %d alignments %d