From 8617d0603b9d8b0fe4ce89cdee593bb032505230 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Wed, 18 Apr 2018 18:25:53 +0300 Subject: [PATCH] Display a message if a spell the player tries to use via a quick key is missing (fixes #4391) --- apps/openmw/mwgui/quickkeysmenu.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw/mwgui/quickkeysmenu.cpp b/apps/openmw/mwgui/quickkeysmenu.cpp index 6da7b0905..2ce9d04e5 100644 --- a/apps/openmw/mwgui/quickkeysmenu.cpp +++ b/apps/openmw/mwgui/quickkeysmenu.cpp @@ -330,7 +330,12 @@ namespace MWGui MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player); MWMechanics::Spells& spells = stats.getSpells(); if (!spells.hasSpell(spellId)) + { + const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().get().find(spellId); + MWBase::Environment::get().getWindowManager()->messageBox ( + "#{sQuickMenu5} " + spell->mName); return; + } store.setSelectedEnchantItem(store.end()); MWBase::Environment::get().getWindowManager()->setSelectedSpell(spellId, int(MWMechanics::getSpellSuccessChance(spellId, player))); MWBase::Environment::get().getWorld()->getPlayer().setDrawState(MWMechanics::DrawState_Spell);