mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:56:39 +00:00 
			
		
		
		
	Remove NAME handling from MWWorld::ESMStore
This commit is contained in:
		
							parent
							
								
									89e44c8f1f
								
							
						
					
					
						commit
						9301bc148e
					
				
					 1 changed files with 9 additions and 20 deletions
				
			
		|  | @ -95,23 +95,12 @@ void ESMStore::load(ESM::ESMReader &esm, Loading::Listener* listener) | |||
|                 throw std::runtime_error(error.str()); | ||||
|             } | ||||
|         } else { | ||||
|             // Load it
 | ||||
|             std::string id = esm.getHNOString("NAME"); | ||||
|             // ... unless it got deleted! This means that the following record
 | ||||
|             //  has been deleted, and trying to load it using standard assumptions
 | ||||
|             //  on the structure will (probably) fail.
 | ||||
|             if (esm.isNextSub("DELE")) { | ||||
|               esm.skipRecord(); | ||||
|               it->second->eraseStatic(id); | ||||
|               continue; | ||||
|             } | ||||
|             it->second->load(esm, id); | ||||
| 
 | ||||
|             // DELE can also occur after the usual subrecords
 | ||||
|             if (esm.isNextSub("DELE")) { | ||||
|               esm.skipRecord(); | ||||
|               it->second->eraseStatic(id); | ||||
|               continue; | ||||
|             it->second->load(esm); | ||||
|             std::string id = it->second->getLastAddedRecordId(); | ||||
|             if (it->second->isLastAddedRecordDeleted()) | ||||
|             { | ||||
|                 it->second->eraseStatic(id); | ||||
|                 continue; | ||||
|             } | ||||
| 
 | ||||
|             if (n.val==ESM::REC_DIAL) { | ||||
|  | @ -194,13 +183,13 @@ void ESMStore::setUp() | |||
|             case ESM::REC_LEVC: | ||||
| 
 | ||||
|                 { | ||||
|                     std::string id = reader.getHNString ("NAME"); | ||||
|                     mStores[type]->read (reader, id); | ||||
|                     StoreBase *store = mStores[type]; | ||||
|                     store->read (reader); | ||||
| 
 | ||||
|                     // FIXME: there might be stale dynamic IDs in mIds from an earlier savegame
 | ||||
|                     // that really should be cleared instead of just overwritten
 | ||||
| 
 | ||||
|                     mIds[id] = type; | ||||
|                     mIds[store->getLastAddedRecordId()] = type; | ||||
|                 } | ||||
| 
 | ||||
|                 if (type==ESM::REC_NPC_) | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue