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:
@ -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();
|
||||||
|
Reference in New Issue
Block a user