1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -460,8 +460,9 @@ std::vector<std::tuple<SpellID, bool>> QuickSpellPanel::getSpells()
if(spellIds[i] != SpellID::NONE)
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()))
{
spellIds[i] = availableSpell->getId();