mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Merge pull request #4388 from kaja47/fix-crash-defense
fix crash when my city without hero is attacked
This commit is contained in:
commit
f34ffcc727
@ -218,7 +218,9 @@ void BattleWindow::showStickyQuickSpellWindow()
|
||||
Settings showStickyQuickSpellWindow = settings.write["battle"]["enableQuickSpellPanel"];
|
||||
showStickyQuickSpellWindow->Bool() = true;
|
||||
|
||||
if(GH.screenDimensions().x >= 1050 && owner.getBattle()->battleGetMyHero()->hasSpellbook())
|
||||
auto hero = owner.getBattle()->battleGetMyHero();
|
||||
|
||||
if(GH.screenDimensions().x >= 1050 && hero != nullptr && hero->hasSpellbook())
|
||||
{
|
||||
quickSpellWindow->enable();
|
||||
quickSpellWindow->isEnabled = true;
|
||||
|
Loading…
Reference in New Issue
Block a user