mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 03:54:40 +00:00
Check for container organic flag before checking weight (Fixes #1654)
This commit is contained in:
parent
6cd739678a
commit
5839691530
@ -195,15 +195,6 @@ namespace MWGui
|
||||
{
|
||||
if (mPtr.getTypeName() == typeid(ESM::Container).name())
|
||||
{
|
||||
// check that we don't exceed container capacity
|
||||
MWWorld::Ptr item = mDragAndDrop->mItem.mBase;
|
||||
float weight = item.getClass().getWeight(item) * mDragAndDrop->mDraggedCount;
|
||||
if (mPtr.getClass().getCapacity(mPtr) < mPtr.getClass().getEncumbrance(mPtr) + weight)
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sContentsMessage3}");
|
||||
return;
|
||||
}
|
||||
|
||||
// check container organic flag
|
||||
MWWorld::LiveCellRef<ESM::Container>* ref = mPtr.get<ESM::Container>();
|
||||
if (ref->mBase->mFlags & ESM::Container::Organic)
|
||||
@ -212,6 +203,15 @@ namespace MWGui
|
||||
messageBox("#{sContentsMessage2}");
|
||||
return;
|
||||
}
|
||||
|
||||
// check that we don't exceed container capacity
|
||||
MWWorld::Ptr item = mDragAndDrop->mItem.mBase;
|
||||
float weight = item.getClass().getWeight(item) * mDragAndDrop->mDraggedCount;
|
||||
if (mPtr.getClass().getCapacity(mPtr) < mPtr.getClass().getEncumbrance(mPtr) + weight)
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sContentsMessage3}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
mDragAndDrop->drop(mModel, mItemView);
|
||||
|
Loading…
Reference in New Issue
Block a user