mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:56:39 +00:00 
			
		
		
		
	Fix dynamically placed objects being discarded when loading game
This commit is contained in:
		
							parent
							
								
									f05606657c
								
							
						
					
					
						commit
						cd1b4218e7
					
				
					 1 changed files with 10 additions and 6 deletions
				
			
		|  | @ -52,7 +52,7 @@ namespace | |||
|                 iter!=collection.mList.end(); ++iter) | ||||
|             { | ||||
|                 if (iter->mData.getCount()==0 && iter->mRef.mRefNum.mContentFile==-1) | ||||
|                     continue; // deleted file that did not came from a content file -> ignore
 | ||||
|                     continue; // deleted reference that did not come from a content file -> ignore
 | ||||
| 
 | ||||
|                 RecordType state; | ||||
|                 iter->save (state); | ||||
|  | @ -72,13 +72,17 @@ namespace | |||
|         RecordType state; | ||||
|         state.load (reader); | ||||
| 
 | ||||
|         std::map<int, int>::const_iterator iter = | ||||
|             contentFileMap.find (state.mRef.mRefNum.mContentFile); | ||||
|         // If the reference came from a content file, make sure this content file is loaded
 | ||||
|         if (state.mRef.mRefNum.mContentFile != -1) | ||||
|         { | ||||
|             std::map<int, int>::const_iterator iter = | ||||
|                 contentFileMap.find (state.mRef.mRefNum.mContentFile); | ||||
| 
 | ||||
|         if (iter==contentFileMap.end()) | ||||
|             return; // content file has been removed -> skip
 | ||||
|             if (iter==contentFileMap.end()) | ||||
|                 return; // content file has been removed -> skip
 | ||||
| 
 | ||||
|         state.mRef.mRefNum.mContentFile = iter->second; | ||||
|             state.mRef.mRefNum.mContentFile = iter->second; | ||||
|         } | ||||
| 
 | ||||
|         if (!MWWorld::LiveCellRef<T>::checkState (state)) | ||||
|             return; // not valid anymore with current content files -> skip
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue