1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00
This commit is contained in:
AlexVinS
2016-10-17 03:33:29 +03:00
parent ba5b65ff93
commit bc2f0ba6f1
2 changed files with 12 additions and 2 deletions

View File

@@ -829,6 +829,6 @@ void CSpellWindow::SpellArea::setSpell(const CSpell * spell)
image->setFrame(mySpell->id); image->setFrame(mySpell->id);
image->visible = true; image->visible = true;
schoolBorder = owner->schoolBorders[whichSchool]->getImage(schoolLevel,0); schoolBorder = owner->schoolBorders[owner->selectedTab >= 4 ? whichSchool : owner->selectedTab]->getImage(schoolLevel,0);
} }
} }

View File

@@ -69,6 +69,15 @@ namespace SpellConfig
Bonus::EARTH_SPELLS Bonus::EARTH_SPELLS
} }
}; };
//order as described in http://bugs.vcmi.eu/view.php?id=91
static const ESpellSchool SCHOOL_ORDER[4] =
{
ESpellSchool::AIR, //=0
ESpellSchool::FIRE, //=1
ESpellSchool::EARTH,//=3(!)
ESpellSchool::WATER //=2(!)
};
} }
///CSpell::LevelInfo ///CSpell::LevelInfo
@@ -226,8 +235,9 @@ CSpell::ETargetType CSpell::getTargetType() const
void CSpell::forEachSchool(const std::function<void(const SpellSchoolInfo &, bool &)>& cb) const void CSpell::forEachSchool(const std::function<void(const SpellSchoolInfo &, bool &)>& cb) const
{ {
bool stop = false; bool stop = false;
for(const SpellSchoolInfo & cnf : SpellConfig::SCHOOL) for(ESpellSchool iter : SpellConfig::SCHOOL_ORDER)
{ {
const SpellSchoolInfo & cnf = SpellConfig::SCHOOL[(ui8)iter];
if(school.at(cnf.id)) if(school.at(cnf.id))
{ {
cb(cnf, stop); cb(cnf, stop);