1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-29 09:15:35 +00:00

Fix GUI crash due to outdated spells list

This commit is contained in:
scrawl 2014-12-15 20:20:17 +01:00
parent ec00c830e5
commit 0dc9401269
3 changed files with 10 additions and 1 deletions

View file

@ -124,6 +124,8 @@ namespace MWGui
if (targetView)
targetView->update();
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->updateItemView();
// We need to update the view since an other item could be auto-equipped.
mSourceView->update();
}

View file

@ -309,6 +309,9 @@ namespace MWGui
void InventoryWindow::updateItemView()
{
if (MWBase::Environment::get().getWindowManager()->getSpellWindow())
MWBase::Environment::get().getWindowManager()->getSpellWindow()->updateSpells();
mItemView->update();
mPreviewDirty = true;
}
@ -614,6 +617,9 @@ namespace MWGui
mDragAndDrop->startDrag(i, mSortModel, mTradeModel, mItemView, count);
MWBase::Environment::get().getMechanicsManager()->itemTaken(player, newObject, count);
if (MWBase::Environment::get().getWindowManager()->getSpellWindow())
MWBase::Environment::get().getWindowManager()->getSpellWindow()->updateSpells();
}
void InventoryWindow::cycle(bool next)

View file

@ -79,7 +79,8 @@ namespace MWGui
break;
}
}
assert(it != store.end());
if (it == store.end())
throw std::runtime_error("can't find selected item");
// equip, if it can be equipped and is not already equipped
if (!alreadyEquipped