1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-17 01:32:21 +02:00

Update client/battle/BattleInterfaceClasses.cpp

Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
This commit is contained in:
Laserlicht
2024-08-01 21:42:32 +02:00
committed by GitHub
parent 136f33f950
commit 405bc09780

View File

@ -460,8 +460,9 @@ std::vector<std::tuple<SpellID, bool>> QuickSpellPanel::getSpells()
if(spellIds[i] != SpellID::NONE) if(spellIds[i] != SpellID::NONE)
continue; continue;
for(auto & availableSpell : CGI->spellh->objects) for(const auto & availableSpellID : CGI->spellh->getDefaultAllowed())
{ {
const auto * availableSpell = availableSpellID->toSpell();
if(!availableSpell->isAdventure() && !availableSpell->isCreatureAbility() && hero->canCastThisSpell(availableSpell.get()) && !vstd::contains(spellIds, availableSpell->getId())) if(!availableSpell->isAdventure() && !availableSpell->isCreatureAbility() && hero->canCastThisSpell(availableSpell.get()) && !vstd::contains(spellIds, availableSpell->getId()))
{ {
spellIds[i] = availableSpell->getId(); spellIds[i] = availableSpell->getId();