mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +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 = "";
|
mSelectedSpell = "";
|
||||||
mHud->unsetSelectedSpell();
|
mHud->unsetSelectedSpell();
|
||||||
|
|
||||||
|
MWWorld::Player* player = &MWBase::Environment::get().getWorld()->getPlayer();
|
||||||
|
if (player->getDrawState() == MWMechanics::DrawState_Spell)
|
||||||
|
player->setDrawState(MWMechanics::DrawState_Nothing);
|
||||||
|
|
||||||
mSpellWindow->setTitle("#{sNone}");
|
mSpellWindow->setTitle("#{sNone}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -646,6 +646,10 @@ namespace MWInput
|
|||||||
if (!mControlSwitch["playermagic"])
|
if (!mControlSwitch["playermagic"])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Not allowed if no spell selected
|
||||||
|
if (MWBase::Environment::get().getWindowManager()->getSelectedSpell().empty())
|
||||||
|
return;
|
||||||
|
|
||||||
MWMechanics::DrawState_ state = mPlayer->getDrawState();
|
MWMechanics::DrawState_ state = mPlayer->getDrawState();
|
||||||
if (state == MWMechanics::DrawState_Weapon || state == MWMechanics::DrawState_Nothing)
|
if (state == MWMechanics::DrawState_Weapon || state == MWMechanics::DrawState_Nothing)
|
||||||
mPlayer->setDrawState(MWMechanics::DrawState_Spell);
|
mPlayer->setDrawState(MWMechanics::DrawState_Spell);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user