mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Fixes segmentation fault when getting magic strength of a hero
This commit is contained in:
@@ -221,6 +221,10 @@ float HeroManager::getMagicStrength(const CGHeroInstance * hero) const
|
||||
for(auto spellId : hero->getSpellsInSpellbook())
|
||||
{
|
||||
auto spell = spellId.toSpell();
|
||||
|
||||
if (!spell->isAdventure())
|
||||
continue;
|
||||
|
||||
auto schoolLevel = hero->getSpellSchoolLevel(spell);
|
||||
auto townPortalEffect = spell->getAdventureMechanics().getEffectAs<TownPortalEffect>(hero);
|
||||
|
||||
|
Reference in New Issue
Block a user