1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00

Do not allow spellcasting stance without spell selected

This commit is contained in:
Emanuel Guevel 2014-02-11 16:34:51 +01:00
parent 70d35da116
commit a3eea4f6b6
2 changed files with 9 additions and 0 deletions

View File

@ -1035,6 +1035,11 @@ namespace MWGui
{
mSelectedSpell = "";
mHud->unsetSelectedSpell();
MWWorld::Player* player = &MWBase::Environment::get().getWorld()->getPlayer();
if (player->getDrawState() == MWMechanics::DrawState_Spell)
player->setDrawState(MWMechanics::DrawState_Nothing);
mSpellWindow->setTitle("#{sNone}");
}

View File

@ -646,6 +646,10 @@ namespace MWInput
if (!mControlSwitch["playermagic"])
return;
// Not allowed if no spell selected
if (MWBase::Environment::get().getWindowManager()->getSelectedSpell().empty())
return;
MWMechanics::DrawState_ state = mPlayer->getDrawState();
if (state == MWMechanics::DrawState_Weapon || state == MWMechanics::DrawState_Nothing)
mPlayer->setDrawState(MWMechanics::DrawState_Spell);