1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

SpellSchool: use identifier instead of int

Needs redifinition of MAGIC_SCHOOL_SKILL in all mods
This commit is contained in:
Konstantin P
2023-05-05 21:28:07 +03:00
committed by Konstantin
parent 8600e3035a
commit 057a33c508
24 changed files with 93 additions and 65 deletions

View File

@@ -82,11 +82,11 @@ public:
return false;
for(ui8 schoolId = 0; schoolId < 4; schoolId++)
for(auto schoolId = 0; schoolId < GameConstants::DEFAULT_SCHOOLS; schoolId++)
{
if(A->school.at((ESpellSchool)schoolId) && !B->school.at((ESpellSchool)schoolId))
if(A->school.at(SpellSchool(schoolId)) && !B->school.at(SpellSchool(schoolId)))
return true;
if(!A->school.at((ESpellSchool)schoolId) && B->school.at((ESpellSchool)schoolId))
if(!A->school.at(SpellSchool(schoolId)) && B->school.at(SpellSchool(schoolId)))
return false;
}
@@ -320,7 +320,7 @@ void CSpellWindow::computeSpellsPerArea()
for(const CSpell * spell : mySpells)
{
if(spell->isCombat() ^ !battleSpellsOnly
&& ((selectedTab == 4) || spell->school.at((ESpellSchool)selectedTab))
&& ((selectedTab == 4) || spell->school.at(SpellSchool(selectedTab)))
)
{
spellsCurSite.push_back(spell);