1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Reduced usage of global variables - removed or made const / constexpr

This commit is contained in:
Ivan Savenko
2024-02-12 13:49:45 +02:00
parent 6e399eb21a
commit 4c70abbeb5
24 changed files with 39 additions and 99 deletions

View File

@@ -94,7 +94,7 @@ public:
return A->getNameTranslated() < B->getNameTranslated();
}
} spellsorter;
};
CSpellWindow::CSpellWindow(const CGHeroInstance * _myHero, CPlayerInterface * _myInt, bool openOnBattleSpells):
CWindowObject(PLAYER_COLORED | (settings["gameTweaks"]["enableLargeSpellbook"].Bool() ? BORDERED : 0)),
@@ -293,6 +293,8 @@ void CSpellWindow::processSpells()
if(!spell->isCreatureAbility() && myHero->canCastThisSpell(spell) && searchTextFound)
mySpells.push_back(spell);
}
SpellbookSpellSorter spellsorter;
std::sort(mySpells.begin(), mySpells.end(), spellsorter);
//initializing sizes of spellbook's parts