mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Allow learning banned spell from Scholars (H3 logic)
This commit is contained in:
@ -770,7 +770,7 @@ bool CGHeroInstance::canCastThisSpell(const spells::Spell * spell) const
|
||||
}
|
||||
}
|
||||
|
||||
bool CGHeroInstance::canLearnSpell(const spells::Spell * spell) const
|
||||
bool CGHeroInstance::canLearnSpell(const spells::Spell * spell, bool allowBanned) const
|
||||
{
|
||||
if(!hasSpellbook())
|
||||
return false;
|
||||
@ -793,7 +793,7 @@ bool CGHeroInstance::canLearnSpell(const spells::Spell * spell) const
|
||||
return false;//creature abilities can not be learned
|
||||
}
|
||||
|
||||
if(!IObjectInterface::cb->isAllowed(0, spell->getIndex()))
|
||||
if(!allowBanned && !IObjectInterface::cb->isAllowed(0, spell->getIndex()))
|
||||
{
|
||||
logGlobal->warn("Hero %s try to learn banned spell %s", nodeName(), spell->getNameTranslated());
|
||||
return false;//banned spells should not be learned
|
||||
|
Reference in New Issue
Block a user