mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-26 08:56:37 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
	
		
			802 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
	
		
			802 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include "loadlevlist.hpp"
 | |
| 
 | |
| namespace ESM
 | |
| {
 | |
| 
 | |
| void LeveledListBase::load(ESMReader &esm)
 | |
| {
 | |
|     esm.getHNT(flags, "DATA");
 | |
|     esm.getHNT(chanceNone, "NNAM");
 | |
| 
 | |
|     if (esm.isNextSub("INDX"))
 | |
|     {
 | |
|         int len;
 | |
|         esm.getHT(len);
 | |
|         list.resize(len);
 | |
|     }
 | |
|     else
 | |
|         return;
 | |
| 
 | |
|     // TODO: Merge with an existing lists here. This can be done
 | |
|     // simply by adding the lists together, making sure that they are
 | |
|     // sorted by level. A better way might be to exclude repeated
 | |
|     // items. Also, some times we don't want to merge lists, just
 | |
|     // overwrite. Figure out a way to give the user this option.
 | |
| 
 | |
|     for (size_t i = 0; i < list.size(); i++)
 | |
|     {
 | |
|         LevelItem &li = list[i];
 | |
|         li.id = esm.getHNString(recName);
 | |
|         esm.getHNT(li.level, "INTV");
 | |
|     }
 | |
| }
 | |
| 
 | |
| }
 |