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:
parent
70d35da116
commit
a3eea4f6b6
@ -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}");
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user