mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 01:05:48 +01:00 
			
		
		
		
	Make core.get_favorites("local") ignore duplicates (#7926)
This commit is contained in:
		
				
					committed by
					
						
						SmallJoker
					
				
			
			
				
	
			
			
			
						parent
						
							2a74727857
						
					
				
				
					commit
					d11bfa3ef5
				
			@@ -155,6 +155,16 @@ std::vector<ServerListSpec> deSerialize(const std::string &liststring)
 | 
			
		||||
			server["address"] = tmp;
 | 
			
		||||
			std::getline(stream, tmp);
 | 
			
		||||
			server["port"] = tmp;
 | 
			
		||||
			bool unique = true;
 | 
			
		||||
			for (const ServerListSpec &added : serverlist) {
 | 
			
		||||
				if (server["name"] == added["name"]
 | 
			
		||||
						&& server["port"] == added["port"]) {
 | 
			
		||||
					unique = false;
 | 
			
		||||
					break;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			if (!unique)
 | 
			
		||||
				continue;
 | 
			
		||||
			std::getline(stream, tmp);
 | 
			
		||||
			server["description"] = tmp;
 | 
			
		||||
			serverlist.push_back(server);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user