浏览代码

Merge pull request #4330 from Laserlicht/spellbook

check spellbook
Ivan Savenko 1 年之前
父节点
当前提交
6ac3752325
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 1 1
      client/battle/BattleWindow.cpp
  2. 2 0
      lib/battle/CBattleInfoCallback.cpp

+ 1 - 1
client/battle/BattleWindow.cpp

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

+ 2 - 0
lib/battle/CBattleInfoCallback.cpp

@@ -134,6 +134,8 @@ ESpellCastProblem CBattleInfoCallback::battleCanCastSpell(const spells::Caster *
 			return ESpellCastProblem::NO_HERO_TO_CAST_SPELL;
 		if(hero->hasBonusOfType(BonusType::BLOCK_ALL_MAGIC))
 			return ESpellCastProblem::MAGIC_IS_BLOCKED;
+		if(!hero->hasSpellbook())
+			return ESpellCastProblem::NO_SPELLBOOK;
 	}
 		break;
 	default: