Browse Source

Update client/battle/BattleInterfaceClasses.cpp

Co-authored-by: Ivan Savenko <[email protected]>
Laserlicht 1 year ago
parent
commit
405bc09780
1 changed files with 2 additions and 1 deletions
  1. 2 1
      client/battle/BattleInterfaceClasses.cpp

+ 2 - 1
client/battle/BattleInterfaceClasses.cpp

@@ -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();