mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-25 07:56:37 +00:00 
			
		
		
		
	Check for container organic flag before checking weight (Fixes #1654)
This commit is contained in:
		
							parent
							
								
									6cd739678a
								
							
						
					
					
						commit
						5839691530
					
				
					 1 changed files with 9 additions and 9 deletions
				
			
		|  | @ -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 a new issue