1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-25 21:26:38 +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,6 +147,7 @@ namespace MWGui
{ {
mControllerFocus = 0; mControllerFocus = 0;
if (mSpellButtons.size() > 0) if (mSpellButtons.size() > 0)
{
mSpellButtons[0].first->setStateSelected(true); mSpellButtons[0].first->setStateSelected(true);
MWBase::WindowManager* winMgr = MWBase::Environment::get().getWindowManager(); MWBase::WindowManager* winMgr = MWBase::Environment::get().getWindowManager();
@ -154,6 +155,7 @@ namespace MWGui
if (winMgr->getControllerTooltip()) if (winMgr->getControllerTooltip())
MWBase::Environment::get().getInputManager()->warpMouseToWidget(mSpellButtons[0].first); 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 // Canvas size must be expressed with VScroll disabled, otherwise MyGUI would expand the scroll area when the
// scrollbar is hidden // scrollbar is hidden