1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-23 21:29:13 +02:00

check spellbook

This commit is contained in:
Laserlicht 2024-07-26 01:06:54 +02:00 committed by GitHub
parent dbcd7677ac
commit 2d100b00cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -218,7 +218,7 @@ void BattleWindow::showStickyQuickSpellWindow()
Settings showStickyQuickSpellWindow = settings.write["battle"]["enableQuickSpellPanel"];
showStickyQuickSpellWindow->Bool() = true;
if(GH.screenDimensions().x >= 1050)
if(GH.screenDimensions().x >= 1050 && owner.getBattle()->battleGetMyHero()->hasSpellbook())
{
quickSpellWindow->enable();
quickSpellWindow->isEnabled = true;
@ -838,7 +838,7 @@ void BattleWindow::blockUI(bool on)
ESpellCastProblem spellcastingProblem = owner.getBattle()->battleCanCastSpell(hero, spells::Mode::HERO);
//if magic is blocked, we leave button active, so the message can be displayed after button click
canCastSpells = spellcastingProblem == ESpellCastProblem::OK || spellcastingProblem == ESpellCastProblem::MAGIC_IS_BLOCKED;
canCastSpells = (spellcastingProblem == ESpellCastProblem::OK || spellcastingProblem == ESpellCastProblem::MAGIC_IS_BLOCKED) && hero->hasSpellbook();
}
bool canWait = owner.stacksController->getActiveStack() ? !owner.stacksController->getActiveStack()->waitedThisTurn : false;