1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-05 08:45:31 +00:00

Use an array instead of a map in spellSchoolToSkill()

This commit is contained in:
Capostrophic 2020-04-26 16:17:06 +03:00
parent 4838cf7362
commit a3cd3281fb

View file

@ -32,12 +32,12 @@ namespace MWMechanics
{ {
ESM::Skill::SkillEnum spellSchoolToSkill(int school) ESM::Skill::SkillEnum spellSchoolToSkill(int school)
{ {
static const std::map<int, ESM::Skill::SkillEnum> schoolSkillMap static const std::array<ESM::Skill::SkillEnum, 6> schoolSkillArray
{ {
{0, ESM::Skill::Alteration}, {1, ESM::Skill::Conjuration}, {2, ESM::Skill::Destruction}, ESM::Skill::Alteration, ESM::Skill::Conjuration, ESM::Skill::Destruction,
{3, ESM::Skill::Illusion}, {4, ESM::Skill::Mysticism}, {5, ESM::Skill::Restoration} ESM::Skill::Illusion, ESM::Skill::Mysticism, ESM::Skill::Restoration
}; };
return schoolSkillMap.at(school); return schoolSkillArray.at(school);
} }
float calcEffectCost(const ESM::ENAMstruct& effect, const ESM::MagicEffect* magicEffect) float calcEffectCost(const ESM::ENAMstruct& effect, const ESM::MagicEffect* magicEffect)