mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 19:49:41 +00:00
added an assert
This commit is contained in:
parent
f8c20ef77f
commit
c5d685c780
4 changed files with 8 additions and 3 deletions
|
@ -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();
|
||||||
|
@ -266,7 +268,7 @@ void ContainerBase::drawItems()
|
||||||
if (mDragAndDrop->mIsOnDragAndDrop && *iter == *mDragAndDrop->mDraggedWidget->getUserData<MWWorld::Ptr>())
|
if (mDragAndDrop->mIsOnDragAndDrop && *iter == *mDragAndDrop->mDraggedWidget->getUserData<MWWorld::Ptr>())
|
||||||
{
|
{
|
||||||
displayCount -= mDragAndDrop->mDraggedCount;
|
displayCount -= mDragAndDrop->mDraggedCount;
|
||||||
}
|
}
|
||||||
if(displayCount > 0 && !(onlyMagic && MWWorld::Class::get(*iter).getEnchantment(*iter) == "" && iter->getTypeName() != typeid(ESM::Potion).name()))
|
if(displayCount > 0 && !(onlyMagic && MWWorld::Class::get(*iter).getEnchantment(*iter) == "" && iter->getTypeName() != typeid(ESM::Potion).name()))
|
||||||
{
|
{
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,8 @@ WindowManager::~WindowManager()
|
||||||
delete mToolTips;
|
delete mToolTips;
|
||||||
delete mCharGen;
|
delete mCharGen;
|
||||||
delete mDragAndDrop;
|
delete mDragAndDrop;
|
||||||
|
delete mBookWindow;
|
||||||
|
delete mScrollWindow;
|
||||||
|
|
||||||
cleanupGarbage();
|
cleanupGarbage();
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace GUI
|
||||||
|
|
||||||
void shutdown()
|
void shutdown()
|
||||||
{
|
{
|
||||||
MyGUI::LayoutManager::getInstance().unloadLayout(mListWindowRoot);
|
MyGUI::Gui::getInstance().destroyWidget(mMainWidget);
|
||||||
mListWindowRoot.clear();
|
mListWindowRoot.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue