forked from eden-emu/eden
		
	nvmap: Make IocFromId return the same existing handle instead of creating a new one.
Games like Puyo Puyo Tetris and BOTW seem to depend on the buffer always having the same handle
This commit is contained in:
		
							parent
							
								
									26797bd41c
								
							
						
					
					
						commit
						c6e56d6e54
					
				
					 1 changed files with 2 additions and 5 deletions
				
			
		|  | @ -103,11 +103,8 @@ u32 nvmap::IocFromId(const std::vector<u8>& input, std::vector<u8>& output) { | ||||||
|                             [&](const auto& entry) { return entry.second->id == params.id; }); |                             [&](const auto& entry) { return entry.second->id == params.id; }); | ||||||
|     ASSERT(itr != handles.end()); |     ASSERT(itr != handles.end()); | ||||||
| 
 | 
 | ||||||
|     // Make a new handle for the object
 |     // Return the existing handle instead of creating a new one.
 | ||||||
|     u32 handle = next_handle++; |     params.handle = itr->first; | ||||||
|     handles[handle] = itr->second; |  | ||||||
| 
 |  | ||||||
|     params.handle = handle; |  | ||||||
| 
 | 
 | ||||||
|     std::memcpy(output.data(), ¶ms, sizeof(params)); |     std::memcpy(output.data(), ¶ms, sizeof(params)); | ||||||
|     return 0; |     return 0; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Subv
						Subv