1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Refactor CGHeroInstance, make spells private

This commit is contained in:
Andrii Danylchenko
2018-12-20 23:42:31 +02:00
committed by ArseniyShestakov
parent 5d022ba77c
commit 035d279ae8
12 changed files with 64 additions and 41 deletions

View File

@@ -184,15 +184,13 @@ namespace AIPathfinding
}
auto hero = nodeStorage->getHero();
auto summonBoatSpell = SpellID(SpellID::SUMMON_BOAT).toSpell();
if(vstd::contains(hero->spells, SpellID::SUMMON_BOAT))
if(hero->canCastThisSpell(summonBoatSpell)
&& hero->getSpellSchoolLevel(summonBoatSpell) >= SecSkillLevel::ADVANCED)
{
auto summonBoatSpell = SpellID(SpellID::SUMMON_BOAT).toSpell();
if(hero->getSpellSchoolLevel(summonBoatSpell) == SecSkillLevel::EXPERT)
{
summonableVirtualBoat.reset(new SummonBoatAction());
}
// TODO: For lower school level we might need to check the existance of some boat
summonableVirtualBoat.reset(new SummonBoatAction());
}
}