1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-24 22:56:36 +00:00

Fix crash when spell buying window is empty

This commit is contained in:
Andrew Lanzone 2025-07-18 01:05:48 -07:00
parent 0abbf91477
commit a73b803592

View file

@ -147,12 +147,14 @@ namespace MWGui
{
mControllerFocus = 0;
if (mSpellButtons.size() > 0)
{
mSpellButtons[0].first->setStateSelected(true);
MWBase::WindowManager* winMgr = MWBase::Environment::get().getWindowManager();
winMgr->setControllerTooltip(Settings::gui().mControllerTooltips);
if (winMgr->getControllerTooltip())
MWBase::Environment::get().getInputManager()->warpMouseToWidget(mSpellButtons[0].first);
MWBase::WindowManager* winMgr = MWBase::Environment::get().getWindowManager();
winMgr->setControllerTooltip(Settings::gui().mControllerTooltips);
if (winMgr->getControllerTooltip())
MWBase::Environment::get().getInputManager()->warpMouseToWidget(mSpellButtons[0].first);
}
}
// Canvas size must be expressed with VScroll disabled, otherwise MyGUI would expand the scroll area when the