1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-10 03:39:55 +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();
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)
for (std::vector<MWWorld::Ptr>::const_iterator it=equippedItems.begin();
@ -266,7 +268,7 @@ void ContainerBase::drawItems()
if (mDragAndDrop->mIsOnDragAndDrop && *iter == *mDragAndDrop->mDraggedWidget->getUserData<MWWorld::Ptr>())
{
displayCount -= mDragAndDrop->mDraggedCount;
}
}
if(displayCount > 0 && !(onlyMagic && MWWorld::Class::get(*iter).getEnchantment(*iter) == "" && iter->getTypeName() != typeid(ESM::Potion).name()))
{
std::string path = std::string("icons\\");

View File

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

View File

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

View File

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