1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-03 20:49:41 +00:00

added an assert

This commit is contained in:
scrawl 2012-05-16 14:28:57 +02:00
parent f8c20ef77f
commit c5d685c780
4 changed files with 8 additions and 3 deletions

View file

@ -239,7 +239,9 @@ void ContainerBase::drawItems()
for (std::vector<MWWorld::Ptr>::iterator it=unwantedItems.begin(); for (std::vector<MWWorld::Ptr>::iterator it=unwantedItems.begin();
it != unwantedItems.end(); ++it) it != unwantedItems.end(); ++it)
{ {
equippedItems.erase(std::find(unwantedItems.begin(), unwantedItems.end(), *it)); std::vector<MWWorld::Ptr>::iterator found = std::find(unwantedItems.begin(), unwantedItems.end(), *it);
assert(found != unwantedItems.end());
equippedItems.erase(found);
} }
// and add the items that are left (= have the correct category) // and add the items that are left (= have the correct category)
for (std::vector<MWWorld::Ptr>::const_iterator it=equippedItems.begin(); for (std::vector<MWWorld::Ptr>::const_iterator it=equippedItems.begin();

View file

@ -209,6 +209,7 @@ namespace MWGui
if (invStore.getSlot(*slot) == invStore.end()) if (invStore.getSlot(*slot) == invStore.end())
{ {
// slot is not occupied
invStore.equip(*slot, it); invStore.equip(*slot, it);
break; break;
} }

View file

@ -151,6 +151,8 @@ WindowManager::~WindowManager()
delete mToolTips; delete mToolTips;
delete mCharGen; delete mCharGen;
delete mDragAndDrop; delete mDragAndDrop;
delete mBookWindow;
delete mScrollWindow;
cleanupGarbage(); cleanupGarbage();
} }

View file

@ -71,7 +71,7 @@ namespace GUI
void shutdown() void shutdown()
{ {
MyGUI::LayoutManager::getInstance().unloadLayout(mListWindowRoot); MyGUI::Gui::getInstance().destroyWidget(mMainWidget);
mListWindowRoot.clear(); mListWindowRoot.clear();
} }