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:
parent
ec00c830e5
commit
0dc9401269
3 changed files with 10 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue